public class OneHotEncoder extends java.lang.Object implements FeatureGenerator<double[]>
Constructor and Description |
---|
OneHotEncoder(smile.data.Attribute[] attributes)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
smile.data.Attribute[] |
attributes()
Returns the variable attributes of generated features.
|
double[] |
feature(double[] x)
Generates a feature for given object.
|
public OneHotEncoder(smile.data.Attribute[] attributes)
attributes
- the variable attributes. Of which, nominal variables
will be converted to binary dummy variables.public smile.data.Attribute[] attributes()
FeatureGenerator
attributes
in interface FeatureGenerator<double[]>
public double[] feature(double[] x)
FeatureGenerator
feature
in interface FeatureGenerator<double[]>
x
- an object of interest.