Skip to content

Latest commit

 

History

History
468 lines (274 loc) · 12.2 KB

MinMaxScaler.md

File metadata and controls

468 lines (274 loc) · 12.2 KB

MinMaxScaler

Transform features by scaling each feature to a given range.

This estimator scales and translates each feature individually such that it is in the given range on the training set, e.g. between zero and one.

The transformation is given by:

Python Reference

Constructors

constructor()

Signature

new MinMaxScaler(opts?: object): MinMaxScaler;

Parameters

Name Type Description
opts? object -
opts.clip? boolean Set to true to clip transformed values of held-out data to provided feature range. Default Value false
opts.copy? boolean Set to false to perform inplace row normalization and avoid a copy (if the input is already a numpy array). Default Value true
opts.feature_range? any Desired range of transformed data.

Returns

MinMaxScaler

Defined in: generated/preprocessing/MinMaxScaler.ts:25

Methods

dispose()

Disposes of the underlying Python resources.

Once dispose() is called, the instance is no longer usable.

Signature

dispose(): Promise<void>;

Returns

Promise<void>

Defined in: generated/preprocessing/MinMaxScaler.ts:104

fit()

Compute the minimum and maximum to be used for later scaling.

Signature

fit(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike[] The data used to compute the per-feature minimum and maximum used for later scaling along the features axis.
opts.y? any Ignored.

Returns

Promise<any>

Defined in: generated/preprocessing/MinMaxScaler.ts:121

fit_transform()

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit\_params and returns a transformed version of X.

Signature

fit_transform(opts: object): Promise<any[]>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike[] Input samples.
opts.fit_params? any Additional fit parameters.
opts.y? ArrayLike Target values (undefined for unsupervised transformations).

Returns

Promise<any[]>

Defined in: generated/preprocessing/MinMaxScaler.ts:161

get_feature_names_out()

Get output feature names for transformation.

Signature

get_feature_names_out(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.input_features? any Input features.

Returns

Promise<any>

Defined in: generated/preprocessing/MinMaxScaler.ts:208

get_metadata_routing()

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Signature

get_metadata_routing(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.routing? any A MetadataRequest encapsulating routing information.

Returns

Promise<any>

Defined in: generated/preprocessing/MinMaxScaler.ts:246

init()

Initializes the underlying Python resources.

This instance is not usable until the Promise returned by init() resolves.

Signature

init(py: PythonBridge): Promise<void>;

Parameters

Name Type
py PythonBridge

Returns

Promise<void>

Defined in: generated/preprocessing/MinMaxScaler.ts:62

inverse_transform()

Undo the scaling of X according to feature_range.

Signature

inverse_transform(opts: object): Promise<ArrayLike[]>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike[] Input data that will be transformed. It cannot be sparse.

Returns

Promise<ArrayLike[]>

Defined in: generated/preprocessing/MinMaxScaler.ts:281

partial_fit()

Online computation of min and max on X for later scaling.

All of X is processed as a single batch. This is intended for cases when fit is not feasible due to very large number of n\_samples or because X is read from a continuous stream.

Signature

partial_fit(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike[] The data used to compute the mean and standard deviation used for later scaling along the features axis.
opts.y? any Ignored.

Returns

Promise<any>

Defined in: generated/preprocessing/MinMaxScaler.ts:318

set_output()

Set output container.

See Introducing the set_output API for an example on how to use the API.

Signature

set_output(opts: object): Promise<any>;

Parameters

Name Type Description
opts object -
opts.transform? "default" | "pandas" Configure output of transform and fit\_transform.

Returns

Promise<any>

Defined in: generated/preprocessing/MinMaxScaler.ts:358

transform()

Scale features of X according to feature_range.

Signature

transform(opts: object): Promise<ArrayLike[]>;

Parameters

Name Type Description
opts object -
opts.X? ArrayLike[] Input data that will be transformed.

Returns

Promise<ArrayLike[]>

Defined in: generated/preprocessing/MinMaxScaler.ts:391

Properties

_isDisposed

boolean = false

Defined in: generated/preprocessing/MinMaxScaler.ts:23

_isInitialized

boolean = false

Defined in: generated/preprocessing/MinMaxScaler.ts:22

_py

PythonBridge

Defined in: generated/preprocessing/MinMaxScaler.ts:21

id

string

Defined in: generated/preprocessing/MinMaxScaler.ts:18

opts

any

Defined in: generated/preprocessing/MinMaxScaler.ts:19

Accessors

data_max_

Per feature maximum seen in the data

Signature

data_max_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/preprocessing/MinMaxScaler.ts:495

data_min_

Per feature minimum seen in the data

Signature

data_min_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/preprocessing/MinMaxScaler.ts:470

data_range_

Per feature range (data\_max\_ \- data\_min\_) seen in the data

Signature

data_range_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/preprocessing/MinMaxScaler.ts:520

feature_names_in_

Names of features seen during fit. Defined only when X has feature names that are all strings.

Signature

feature_names_in_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/preprocessing/MinMaxScaler.ts:595

min_

Per feature adjustment for minimum. Equivalent to min \- X.min(axis=0) \* self.scale\_

Signature

min_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/preprocessing/MinMaxScaler.ts:424

n_features_in_

Number of features seen during fit.

Signature

n_features_in_(): Promise<number>;

Returns

Promise<number>

Defined in: generated/preprocessing/MinMaxScaler.ts:545

n_samples_seen_

The number of samples processed by the estimator. It will be reset on new calls to fit, but increments across partial\_fit calls.

Signature

n_samples_seen_(): Promise<number>;

Returns

Promise<number>

Defined in: generated/preprocessing/MinMaxScaler.ts:570

py

Signature

py(): PythonBridge;

Returns

PythonBridge

Defined in: generated/preprocessing/MinMaxScaler.ts:49

Signature

py(pythonBridge: PythonBridge): void;

Parameters

Name Type
pythonBridge PythonBridge

Returns

void

Defined in: generated/preprocessing/MinMaxScaler.ts:53

scale_

Per feature relative scaling of the data. Equivalent to (max \- min) / (X.max(axis=0) \- X.min(axis=0))

Signature

scale_(): Promise<ArrayLike>;

Returns

Promise<ArrayLike>

Defined in: generated/preprocessing/MinMaxScaler.ts:447