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