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 (opens in a new tab)
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
Defined in: generated/preprocessing/MinMaxScaler.ts:25 (opens in a new tab)
Properties
_isDisposed
boolean
=false
Defined in: generated/preprocessing/MinMaxScaler.ts:23 (opens in a new tab)
_isInitialized
boolean
=false
Defined in: generated/preprocessing/MinMaxScaler.ts:22 (opens in a new tab)
_py
PythonBridge
Defined in: generated/preprocessing/MinMaxScaler.ts:21 (opens in a new tab)
id
string
Defined in: generated/preprocessing/MinMaxScaler.ts:18 (opens in a new tab)
opts
any
Defined in: generated/preprocessing/MinMaxScaler.ts:19 (opens in a new tab)
Accessors
data_max_
Per feature maximum seen in the data
Signature
data_max_(): Promise<ArrayLike>;
Returns
Promise
<ArrayLike
>
Defined in: generated/preprocessing/MinMaxScaler.ts:458 (opens in a new tab)
data_min_
Per feature minimum seen in the data
Signature
data_min_(): Promise<ArrayLike>;
Returns
Promise
<ArrayLike
>
Defined in: generated/preprocessing/MinMaxScaler.ts:433 (opens in a new tab)
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:483 (opens in a new tab)
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:558 (opens in a new tab)
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:387 (opens in a new tab)
n_features_in_
Number of features seen during fit.
Signature
n_features_in_(): Promise<number>;
Returns
Promise
<number
>
Defined in: generated/preprocessing/MinMaxScaler.ts:508 (opens in a new tab)
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:533 (opens in a new tab)
py
Signature
py(): PythonBridge;
Returns
PythonBridge
Defined in: generated/preprocessing/MinMaxScaler.ts:49 (opens in a new tab)
Signature
py(pythonBridge: PythonBridge): void;
Parameters
Name | Type |
---|---|
pythonBridge | PythonBridge |
Returns
void
Defined in: generated/preprocessing/MinMaxScaler.ts:53 (opens in a new tab)
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:410 (opens in a new tab)
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 (opens in a new tab)
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 (opens in a new tab)
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 (opens in a new tab)
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 (opens in a new tab)
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 (opens in a new tab)
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:244 (opens in a new tab)
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:281 (opens in a new tab)
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:321 (opens in a new tab)
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:354 (opens in a new tab)