Class: MaxAbsScaler

Scale each feature by its maximum absolute value.

This estimator scales and translates each feature individually such that the maximal absolute value of each feature in the training set will be 1.0. It does not shift/center the data, and thus does not destroy any sparsity.

This scaler can also be applied to sparse CSR or CSC matrices.

MaxAbsScaler doesn’t reduce the effect of outliers; it only linearly scales them down. For an example visualization, refer to Compare MaxAbsScaler with other scalers.

Python Reference

Constructors

new MaxAbsScaler()

new MaxAbsScaler(opts?): MaxAbsScaler

Parameters

ParameterTypeDescription
opts?object-
opts.copy?booleanSet to false to perform inplace scaling and avoid a copy (if the input is already a numpy array).

Returns MaxAbsScaler

Defined in generated/preprocessing/MaxAbsScaler.ts:27

Properties

PropertyTypeDefault valueDefined in
_isDisposedbooleanfalsegenerated/preprocessing/MaxAbsScaler.ts:25
_isInitializedbooleanfalsegenerated/preprocessing/MaxAbsScaler.ts:24
_pyPythonBridgeundefinedgenerated/preprocessing/MaxAbsScaler.ts:23
idstringundefinedgenerated/preprocessing/MaxAbsScaler.ts:20
optsanyundefinedgenerated/preprocessing/MaxAbsScaler.ts:21

Accessors

feature_names_in_

Get Signature

get feature_names_in_(): Promise<ArrayLike>

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

Returns Promise<ArrayLike>

Defined in generated/preprocessing/MaxAbsScaler.ts:469


max_abs_

Get Signature

get max_abs_(): Promise<ArrayLike>

Per feature maximum absolute value.

Returns Promise<ArrayLike>

Defined in generated/preprocessing/MaxAbsScaler.ts:421


n_features_in_

Get Signature

get n_features_in_(): Promise<number>

Number of features seen during fit.

Returns Promise<number>

Defined in generated/preprocessing/MaxAbsScaler.ts:444


n_samples_seen_

Get Signature

get n_samples_seen_(): Promise<number>

The number of samples processed by the estimator. Will be reset on new calls to fit, but increments across partial_fit calls.

Returns Promise<number>

Defined in generated/preprocessing/MaxAbsScaler.ts:494


py

Get Signature

get py(): PythonBridge

Returns PythonBridge

Set Signature

set py(pythonBridge): void

Parameters

ParameterType
pythonBridgePythonBridge

Returns void

Defined in generated/preprocessing/MaxAbsScaler.ts:39


scale_

Get Signature

get scale_(): Promise<ArrayLike>

Per feature relative scaling of the data.

Returns Promise<ArrayLike>

Defined in generated/preprocessing/MaxAbsScaler.ts:398

Methods

dispose()

dispose(): Promise<void>

Disposes of the underlying Python resources.

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

Returns Promise<void>

Defined in generated/preprocessing/MaxAbsScaler.ts:91


fit()

fit(opts): Promise<any>

Compute the maximum absolute value to be used for later scaling.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeThe data used to compute the per-feature minimum and maximum used for later scaling along the features axis.
opts.y?anyIgnored.

Returns Promise<any>

Defined in generated/preprocessing/MaxAbsScaler.ts:108


fit_transform()

fit_transform(opts): Promise<any[]>

Fit to data, then transform it.

Fits transformer to X and y with optional parameters fit_params and returns a transformed version of X.

Parameters

ParameterTypeDescription
optsobject-
opts.fit_params?anyAdditional fit parameters.
opts.X?ArrayLike[]Input samples.
opts.y?ArrayLikeTarget values (undefined for unsupervised transformations).

Returns Promise<any[]>

Defined in generated/preprocessing/MaxAbsScaler.ts:147


get_feature_names_out()

get_feature_names_out(opts): Promise<any>

Get output feature names for transformation.

Parameters

ParameterTypeDescription
optsobject-
opts.input_features?anyInput features.

Returns Promise<any>

Defined in generated/preprocessing/MaxAbsScaler.ts:189


get_metadata_routing()

get_metadata_routing(opts): Promise<any>

Get metadata routing of this object.

Please check User Guide on how the routing mechanism works.

Parameters

ParameterTypeDescription
optsobject-
opts.routing?anyA MetadataRequest encapsulating routing information.

Returns Promise<any>

Defined in generated/preprocessing/MaxAbsScaler.ts:225


init()

init(py): Promise<void>

Initializes the underlying Python resources.

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

Parameters

ParameterType
pyPythonBridge

Returns Promise<void>

Defined in generated/preprocessing/MaxAbsScaler.ts:52


inverse_transform()

inverse_transform(opts): Promise<ArrayLike>

Scale back the data to the original representation.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeThe data that should be transformed back.

Returns Promise<ArrayLike>

Defined in generated/preprocessing/MaxAbsScaler.ts:259


partial_fit()

partial_fit(opts): Promise<any>

Online computation of max absolute value of 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.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeThe data used to compute the mean and standard deviation used for later scaling along the features axis.
opts.y?anyIgnored.

Returns Promise<any>

Defined in generated/preprocessing/MaxAbsScaler.ts:295


set_output()

set_output(opts): Promise<any>

Set output container.

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

Parameters

ParameterTypeDescription
optsobject-
opts.transform?"default" | "pandas" | "polars"Configure output of transform and fit_transform.

Returns Promise<any>

Defined in generated/preprocessing/MaxAbsScaler.ts:334


transform()

transform(opts): Promise<ArrayLike>

Scale the data.

Parameters

ParameterTypeDescription
optsobject-
opts.X?ArrayLikeThe data that should be scaled.

Returns Promise<ArrayLike>

Defined in generated/preprocessing/MaxAbsScaler.ts:366