Package smile.feature.extraction
Class BinaryEncoder
java.lang.Object
smile.feature.extraction.BinaryEncoder
Encodes categorical features using sparse one-hot scheme. The categorical
attributes will be converted to binary dummy variables in a compact
representation in which only indices of nonzero elements are stored in
an integer array. In Maximum Entropy Classifier, the data are expected
to store in this format.
-
Constructor Details
-
BinaryEncoder
Constructor.- Parameters:
schema
- the data frame schema.columns
- the column names of categorical variables. If empty, all categorical columns will be used.
-
-
Method Details
-
apply
Generates the compact representation of sparse binary features for given object. -
apply
Generates the compact representation of sparse binary features for a data frame.- Parameters:
data
- a data frame.- Returns:
- the binary feature vectors.
-