skmultiflow.transform.OneHotToCategorical

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

Transform 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.

Methods

fit(self, X, y)

get_info(self)

Collects and returns the information about the configuration of the estimator

get_params(self[, deep])

Get parameters for this estimator.

partial_fit(self, X[, y, classes])

Partial fit the Transformer object.

partial_fit_transform(self, X[, y, classes])

Partial fit and transform the Transformer object.

reset(self)

Resets the estimator to its initial state.

set_params(self, **params)

Set the parameters of this estimator.

transform(self, X)

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

get_info(self)[source]

Collects and returns the information about the configuration of the estimator

Returns
string

Configuration of the estimator.

get_params(self, deep=True)[source]

Get parameters for this estimator.

Parameters
deepboolean, optional

If True, will return the parameters for this estimator and contained subobjects that are estimators.

Returns
paramsmapping of string to any

Parameter names mapped to their values.

partial_fit(self, 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
StreamTransform

The partially fitted model.

partial_fit_transform(self, 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
StreamTransform

The partially fitted model.

reset(self)[source]

Resets the estimator to its initial state.

Returns
self
set_params(self, **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
self
transform(self, 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
numpy.ndarray

The transformed data.