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:
new MinMaxScaler(opts?: object): MinMaxScaler;
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. |
Defined in: generated/preprocessing/MinMaxScaler.ts:25
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
dispose(): Promise<void>;
Promise
<void
>
Defined in: generated/preprocessing/MinMaxScaler.ts:104
Compute the minimum and maximum to be used for later scaling.
fit(opts: object): Promise<any>;
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. |
Promise
<any
>
Defined in: generated/preprocessing/MinMaxScaler.ts:121
Fit to data, then transform it.
Fits transformer to X
and y
with optional parameters fit\_params
and returns a transformed version of X
.
fit_transform(opts: object): Promise<any[]>;
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). |
Promise
<any
[]>
Defined in: generated/preprocessing/MinMaxScaler.ts:161
Get output feature names for transformation.
get_feature_names_out(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.input_features? |
any |
Input features. |
Promise
<any
>
Defined in: generated/preprocessing/MinMaxScaler.ts:208
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
get_metadata_routing(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.routing? |
any |
A MetadataRequest encapsulating routing information. |
Promise
<any
>
Defined in: generated/preprocessing/MinMaxScaler.ts:246
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
init(py: PythonBridge): Promise<void>;
Name | Type |
---|---|
py |
PythonBridge |
Promise
<void
>
Defined in: generated/preprocessing/MinMaxScaler.ts:62
Undo the scaling of X according to feature_range.
inverse_transform(opts: object): Promise<ArrayLike[]>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike [] |
Input data that will be transformed. It cannot be sparse. |
Promise
<ArrayLike
[]>
Defined in: generated/preprocessing/MinMaxScaler.ts:281
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.
partial_fit(opts: object): Promise<any>;
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. |
Promise
<any
>
Defined in: generated/preprocessing/MinMaxScaler.ts:318
Set output container.
See Introducing the set_output API for an example on how to use the API.
set_output(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.transform? |
"default" | "pandas" |
Configure output of transform and fit\_transform . |
Promise
<any
>
Defined in: generated/preprocessing/MinMaxScaler.ts:358
Scale features of X according to feature_range.
transform(opts: object): Promise<ArrayLike[]>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike [] |
Input data that will be transformed. |
Promise
<ArrayLike
[]>
Defined in: generated/preprocessing/MinMaxScaler.ts:391
boolean
=false
Defined in: generated/preprocessing/MinMaxScaler.ts:23
boolean
=false
Defined in: generated/preprocessing/MinMaxScaler.ts:22
PythonBridge
Defined in: generated/preprocessing/MinMaxScaler.ts:21
string
Defined in: generated/preprocessing/MinMaxScaler.ts:18
any
Defined in: generated/preprocessing/MinMaxScaler.ts:19
Per feature maximum seen in the data
data_max_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/preprocessing/MinMaxScaler.ts:495
Per feature minimum seen in the data
data_min_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/preprocessing/MinMaxScaler.ts:470
Per feature range (data\_max\_ \- data\_min\_)
seen in the data
data_range_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/preprocessing/MinMaxScaler.ts:520
Names of features seen during fit. Defined only when X
has feature names that are all strings.
feature_names_in_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/preprocessing/MinMaxScaler.ts:595
Per feature adjustment for minimum. Equivalent to min \- X.min(axis=0) \* self.scale\_
min_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/preprocessing/MinMaxScaler.ts:424
Number of features seen during fit.
n_features_in_(): Promise<number>;
Promise
<number
>
Defined in: generated/preprocessing/MinMaxScaler.ts:545
The number of samples processed by the estimator. It will be reset on new calls to fit, but increments across partial\_fit
calls.
n_samples_seen_(): Promise<number>;
Promise
<number
>
Defined in: generated/preprocessing/MinMaxScaler.ts:570
py(): PythonBridge;
PythonBridge
Defined in: generated/preprocessing/MinMaxScaler.ts:49
py(pythonBridge: PythonBridge): void;
Name | Type |
---|---|
pythonBridge |
PythonBridge |
void
Defined in: generated/preprocessing/MinMaxScaler.ts:53
Per feature relative scaling of the data. Equivalent to (max \- min) / (X.max(axis=0) \- X.min(axis=0))
scale_(): Promise<ArrayLike>;
Promise
<ArrayLike
>
Defined in: generated/preprocessing/MinMaxScaler.ts:447