edu.washington.cs.knowitall.extractor.conf.featureset
Class DoubleFeatureSet<T>
java.lang.Object
edu.washington.cs.knowitall.extractor.conf.featureset.FeatureSet<T>
edu.washington.cs.knowitall.extractor.conf.featureset.DoubleFeatureSet<T>
- Type Parameters:
T -
public class DoubleFeatureSet<T>
- extends FeatureSet<T>
Represents a set of boolean feature functions that can be applied to objects
of type T. Each feature is represented as a
Predicate object, and has a String name.
- Author:
- afader
|
Method Summary |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DoubleFeatureSet
public DoubleFeatureSet(Map<String,com.google.common.base.Function<T,Double>> givenFeatures)
- Constructs a new feature set from the given features.
- Parameters:
givenFeatures -
featurize
public SortedMap<String,Double> featurize(T object)
- Returns a feature representation of the given object.
- Parameters:
object -
- Returns:
- a sorted map, mapping feature names to boolean values
featurizeToDouble
public double[] featurizeToDouble(T object)
- Returns the feature representation of object as an array of doubles. Each
value in the array corresponds to a feature (where 1.0 is true and 0.0 is
false). The ith value corresponds to the ith feature.
- Overrides:
featurizeToDouble in class FeatureSet<T>
- Parameters:
object -
- Returns:
getFeatures
public 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.
- Returns:
featurize
public double featurize(String featureName,
T object)
- Specified by:
featurize in class FeatureSet<T>
Copyright © 2010-2012 University of Washington CSE. All Rights Reserved.