skopt.space.transformers
.CategoricalEncoder¶
-
class
skopt.space.transformers.
CategoricalEncoder
[source][source]¶ OneHotEncoder that can handle categorical variables.
Methods
fit
(self, X)Fit a list or array of categories.
inverse_transform
(self, Xt)Inverse transform one-hot encoded categories back to their original
transform
(self, X)Transform an array of categories to a one-hot encoded representation.
-
fit
(self, X)[source][source]¶ Fit a list or array of categories.
- Parameters
- Xarray-like, shape=(n_categories,)
List of categories.
-