public class FeatureMap extends Object
Constructor and Description |
---|
FeatureMap(FeatureDictionary dictionary) |
Modifier and Type | Method and Description |
---|---|
void |
addBooleanFeature(String name,
boolean addFeaturesToDictionary)
This implicitly maps the given feature to the value 1.
|
void |
addNumericFeature(String name,
double value,
boolean addFeaturesToDictionary) |
FeatureDictionary |
getDictionary() |
SortedMap<Integer,Double> |
getFeatures()
Returns a sparse representation of the features for this datapoint using
the feature indices that are part of the FeatureDictionary.
|
Double |
getValue(int index)
Returns the value for the given feature or null if the feature is
unknown.
|
Double |
getValue(String name)
Returns the value for the given feature or null if the feature is
unknown.
|
public FeatureMap(FeatureDictionary dictionary)
public void addNumericFeature(String name, double value, boolean addFeaturesToDictionary)
public void addBooleanFeature(String name, boolean addFeaturesToDictionary)
public Double getValue(int index)
index
- public Double getValue(String name)
name
- public FeatureDictionary getDictionary()
public SortedMap<Integer,Double> getFeatures()
Copyright © 2014. All rights reserved.