dtoolkit.transformer.OneHotEncoder.transform#
- OneHotEncoder.transform(X: TwoDimArray) TwoDimArray | csr_matrix[source]#
Transform X using one-hot encoding.
If there are infrequent categories for a feature, the infrequent categories will be grouped into a single category.
- Parameters
- Xarray-like of shape (n_samples, n_features)
The data to encode.
- Returns
- X_out{ndarray, sparse matrix} of shape (n_samples, n_encoded_features)
Transformed input. If sparse_output=True, a sparse matrix will be returned.
Notes
This would let
DataFrameout.