smile.feature
Class SparseOneHotEncoder
- java.lang.Object
-
- smile.feature.SparseOneHotEncoder
-
public class SparseOneHotEncoder extends java.lang.ObjectEncode categorical integer features using sparse one-hot scheme. All variables should be nominal attributes and 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 Summary
Constructors Constructor and Description SparseOneHotEncoder(Attribute[] attributes)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int[]feature(double[] x)Generates the compact representation of sparse binary features for given object.
-
-
-
Constructor Detail
-
SparseOneHotEncoder
public SparseOneHotEncoder(Attribute[] attributes)
Constructor.- Parameters:
attributes- the variable attributes. All of them have to be nominal attributes.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG