MaxAbsScaler

class ibex.sklearn.preprocessing.MaxAbsScaler(copy=True)

Bases: sklearn.preprocessing.data.MaxAbsScaler, ibex._base.FrameMixin

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

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.

New in version 0.17.

copy : boolean, optional, default is True
Set to False to perform inplace scaling and avoid a copy (if the input is already a numpy array).
scale_ : ndarray, shape (n_features,)

Per feature relative scaling of the data.

New in version 0.17: scale_ attribute.

max_abs_ : ndarray, shape (n_features,)
Per feature maximum absolute value.
n_samples_seen_ : int
The number of samples processed by the estimator. Will be reset on new calls to fit, but increments across partial_fit calls.

maxabs_scale: Equivalent function without the estimator API.

For a comparison of the different scalers, transformers, and normalizers, see examples/preprocessing/plot_all_scaling.py.

fit(X, y=None)[source]

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

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

X : {array-like, sparse matrix}, shape [n_samples, n_features]
The data used to compute the per-feature minimum and maximum used for later scaling along the features axis.
fit_transform(X, y=None, **fit_params)

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

Fit to data, then transform it.

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

X : numpy array of shape [n_samples, n_features]
Training set.
y : numpy array of shape [n_samples]
Target values.
X_new : numpy array of shape [n_samples, n_features_new]
Transformed array.
inverse_transform(X)[source]

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

Scale back the data to the original representation

X : {array-like, sparse matrix}
The data that should be transformed back.
partial_fit(X, y=None)[source]

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

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.

X : {array-like, sparse matrix}, shape [n_samples, n_features]
The data used to compute the mean and standard deviation used for later scaling along the features axis.

y : Passthrough for Pipeline compatibility.

transform(X)[source]

Note

The documentation following is of the class wrapped by this class. There are some changes, in particular:

Scale the data

X : {array-like, sparse matrix}
The data that should be scaled.