W3cubDocs

/scikit-learn

sklearn.preprocessing.maxabs_scale

sklearn.preprocessing.maxabs_scale(X, axis=0, copy=True) [source]

Scale each feature to the [-1, 1] range without breaking the sparsity.

This estimator scales each feature individually such that the maximal absolute value of each feature in the training set will be 1.0.

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

Parameters:

X : array-like, shape (n_samples, n_features)

The data.

axis : int (0 by default)

axis used to scale along. If 0, independently scale each feature, otherwise (if 1) scale each sample.

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).

See also

MaxAbsScaler
Performs scaling to the [-1, 1] range using the``Transformer`` API (e.g. as part of a preprocessing sklearn.pipeline.Pipeline).

Notes

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

© 2007–2017 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.maxabs_scale.html