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, sparse matrix} of shape (n_samples, n_features)
:
The data.
axis : {0, 1}, default=0
Axis used to scale along. If 0, independently scale each feature,
otherwise (if 1) scale each sample.
copy : bool, default=True
If False, try to avoid a copy and scale in place.
This is not guaranteed to always work in place; e.g. if the data is
a numpy array with an int dtype, a copy will be returned even with
copy=False.
Returns:
X_tr : {ndarray, sparse matrix} of shape (n_samples, n_features)
The transformed data.
Notes
NaNs are treated as missing values: disregarded to compute the statistics,
and maintained during the data transformation.