MeanCenterer
MeanCenterer()
Column centering of vectors and matrices.
Attributes
-
col_means
: numpy.ndarray [n_columns]NumPy array storing the mean values for centering after fitting the MeanCenterer object.
Examples
For usage examples, please see http://rasbt.github.io/mlxtend/user_guide/preprocessing/MeanCenterer/
Methods
fit(X)
Gets the column means for mean centering.
Parameters
-
X
: {array-like, sparse matrix}, shape = [n_samples, n_features]Array of data vectors, where n_samples is the number of samples and n_features is the number of features.
Returns
self
fit_transform(X)
Fits and transforms an arry.
Parameters
-
X
: {array-like, sparse matrix}, shape = [n_samples, n_features]Array of data vectors, where n_samples is the number of samples and n_features is the number of features.
Returns
-
X_tr
: {array-like, sparse matrix}, shape = [n_samples, n_features]A copy of the input array with the columns centered.
transform(X)
Centers a NumPy array.
Parameters
-
X
: {array-like, sparse matrix}, shape = [n_samples, n_features]Array of data vectors, where n_samples is the number of samples and n_features is the number of features.
Returns
-
X_tr
: {array-like, sparse matrix}, shape = [n_samples, n_features]A copy of the input array with the columns centered.