dtoolkit.transformer.OneHotEncoder.inverse_transform#

OneHotEncoder.inverse_transform(X)#

Convert the data back to the original representation.

When unknown categories are encountered (all zeros in the one-hot encoding), None is used to represent this category. If the feature with the unknown category has a dropped category, the dropped category will be its inverse.

For a given input feature, if there is an infrequent category, ‘infrequent_sklearn’ will be used to represent the infrequent category.

Parameters:
X{array-like, sparse matrix} of shape (n_samples, n_encoded_features)

The transformed data.

Returns:
X_trndarray of shape (n_samples, n_features)

Inverse transformed array.