deephyper.skopt.space.space.LabelEncoder#

class deephyper.skopt.space.space.LabelEncoder(X=None)[source]#

Bases: Transformer

LabelEncoder that can handle categorical variables.

Methods

fit

Fit a list or array of categories.

inverse_transform

Inverse transform integer categories back to their original

transform

Transform an array of categories to a one-hot encoded representation.

fit(X)[source]#

Fit a list or array of categories.

Parameters:

X (array-like, shape=(n_categories,)) – List of categories.

inverse_transform(Xt)[source]#
Inverse transform integer categories back to their original

representation.

Parameters:

Xt (array-like, shape=(n_samples, n_categories)) – Integer categories.

Returns:

X – The original categories.

Return type:

array-like, shape=(n_samples,)

transform(X)[source]#

Transform an array of categories to a one-hot encoded representation.

Parameters:

X (array-like, shape=(n_samples,)) – List of categories.

Returns:

Xt – The integer categories.

Return type:

array-like, shape=(n_samples, n_categories)