sklearn.base.TransformerMixin

class sklearn.base.TransformerMixin[source]

Mixin class for all transformers in scikit-learn.

Methods

fit_transform(X[, y])

Fit to data, then transform it.

fit_transform(X, y=None, **fit_params)[source]

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
X{array-like, sparse matrix, dataframe} of shape (n_samples, n_features)

Input samples.

yndarray of shape (n_samples,), default=None

Target values (None for unsupervised transformations).

**fit_paramsdict

Additional fit parameters.

Returns
X_newndarray array of shape (n_samples, n_features_new)

Transformed array.

Examples using sklearn.base.TransformerMixin