ExtractCategories
ExtractCategories(categories=None, target=None)
This transformer filters the selected dataset categories.
Attributes
categories: list
of categories that you want to keep.
Examples
For usage examples, please see https://jaisenbe58r.github.io/MLearner/user_guide/preprocessing/ReplaceTransformer/
Methods
fit(X, y=None, fit_params)
Gets the columns to make filters the selected dataset categories.
Parameters
-
X
: {Dataframe}, shape = [n_samples, n_features]Dataframe, where n_samples is the number of samples and n_features is the number of features.
Returns
self
fit_transform(X, y=None, fit_params)
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
: numpy array of shape [n_samples, n_features]Training set.
-
y
: numpy array of shape [n_samples]Target values.
Returns
-
X_new
: numpy array of shape [n_samples, n_features_new]Transformed array.
get_params(deep=True)
Get parameters for this estimator.
Parameters
-
deep
: boolean, optionalIf True, will return the parameters for this estimator and contained subobjects that are estimators.
Returns
-
params
: mapping of string to anyParameter names mapped to their values.
set_params(params)
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as pipelines). The latter have parameters of the form
<component>__<parameter>
so that it's possible to update each
component of a nested object.
Returns
self
transform(X)
Gets the columns to make filters the selected dataset categories.
Parameters
-
X
: {Dataframe}, shape = [n_samples, n_features]Dataframe of samples, where n_samples is the number of samples and n_features is the number of features.
Returns
-
X_transform
: {Dataframe}, shape = [n_samples, n_features]A copy of the input Dataframe with the columns replaced.