T - public class BooleanFeatureSet<T> extends FeatureSet<T>
T. Each feature is represented as a
Predicate object, and has a String name.featureNames| Constructor and Description |
|---|
BooleanFeatureSet(Map<String,com.google.common.base.Predicate<T>> givenFeatures)
Constructs a new feature set from the given features.
|
| Modifier and Type | Method and Description |
|---|---|
double |
featurize(String featureName,
T object) |
SortedMap<String,Boolean> |
featurize(T object)
Returns a feature representation of the given object.
|
boolean |
featurizeToBool(String featureName,
T object) |
boolean[] |
featurizeToBool(T object)
Returns the feature representation of object as an array of booleans.
|
double[] |
featurizeToDouble(T object)
Returns the feature representation of object as an array of doubles.
|
Map<String,com.google.common.base.Predicate<T>> |
getFeatures()
Returns the features as an ImmutableList, sorted using the default String
comparator on the features' names.
|
getFeatureNames, getNumFeaturespublic SortedMap<String,Boolean> featurize(T object)
object - public double[] featurizeToDouble(T object)
featurizeToDouble in class FeatureSet<T>object - public boolean[] featurizeToBool(T object)
object - public Map<String,com.google.common.base.Predicate<T>> getFeatures()
public double featurize(String featureName, T object)
featurize in class FeatureSet<T>Copyright © 2010-2013 University of Washington CSE. All Rights Reserved.