skmultiflow.transform.OneHotToCategorical

class skmultiflow.transform.OneHotToCategorical(categorical_list)[source]

Transforms one-hot encoded data into categorical feature(s).

Receives a features matrix, with some binary features (one-hot), and transform them into single categorical feature.

Parameters

categorical_list (list of lists) – Each inner list contains all the attribute indexes that are associated with the same categorical feature.

__init__(categorical_list)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(categorical_list)

Initialize self.

fit(X, y)

get_info()

Collects and returns the information about the configuration of the estimator

get_params([deep])

Get parameters for this estimator.

partial_fit(X[, y, classes])

Partial fit the Transformer object.

partial_fit_transform(X[, y, classes])

Partial fit and transform the Transformer object.

reset()

Resets the estimator to its initial state.

set_params(**params)

Set the parameters of this estimator.

transform(X)

Transform one hot features in the X matrix into int coded categorical features.

get_info()[source]

Collects and returns the information about the configuration of the estimator

Returns

Configuration of the estimator.

Return type

string

get_params(deep=True)[source]

Get parameters for this estimator.

Parameters

deep (boolean, optional) – If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns

params – Parameter names mapped to their values.

Return type

mapping of string to any

partial_fit(X, y=None, classes=None)[source]

Partial fit the Transformer object.

Parameters
  • X (numpy.ndarray of shape (n_samples, n_features)) – The feature’s matrix.

  • y (Array-like) – An array-like with all the class labels from all samples in X.

Returns

The partially fitted model.

Return type

StreamTransform

partial_fit_transform(X, y=None, classes=None)[source]

Partial fit and transform the Transformer object.

Parameters
  • X (numpy.ndarray of shape (n_samples, n_features)) – The feature’s matrix.

  • y (Array-like) – An array-like with all the class labels from all samples in X.

Returns

The partially fitted model.

Return type

StreamTransform

reset()[source]

Resets the estimator to its initial state.

Returns

Return type

self

set_params(**params)[source]

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

Return type

self

transform(X)[source]

Transform one hot features in the X matrix into int coded categorical features.

Parameters

X (numpy.ndarray of shape (n_samples, n_features)) – The sample or set of samples that should be transformed.

Returns

The transformed data.

Return type

numpy.ndarray