edu.washington.cs.knowitall.extractor.conf
Class WekaClassifierConfFunction<T>

java.lang.Object
  extended by edu.washington.cs.knowitall.extractor.conf.WekaClassifierConfFunction<T>
Type Parameters:
T -

public class WekaClassifierConfFunction<T>
extends java.lang.Object

A confidence function that takes an object of type T as input, and returns a real valued number. This function operates in two steps. First, it computes a boolean feature representation of the object using a BooleanFeatureSet object. Second, it passes the featurized object to a binary classifier and returns the confidence of the object belonging to the positive class. The binary classifier is represented by a Weka Classifier object. The caller is responsible for making sure that the features defined by the BooleanFeatureSet object are consistent with the feature representation used by the Classifier object. If the BooleanFeatureSet object has n features, then the Classifier object must have n numeric attributes and one nominal attribute (corresponding to the class value). The order of the features in Classifier must be the same as the order defined by BooleanFeatureSet, with the class attribute appearing last.

Author:
afader

Constructor Summary
WekaClassifierConfFunction(BooleanFeatureSet<T> featureSet, weka.classifiers.Classifier classifier)
          Constructs a new classifier confidence function that uses the given feature set and classifier.
 
Method Summary
 double getConf(T object)
          Computes the confidence that the given object belongs to the positive class according to the classifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WekaClassifierConfFunction

public WekaClassifierConfFunction(BooleanFeatureSet<T> featureSet,
                                  weka.classifiers.Classifier classifier)
Constructs a new classifier confidence function that uses the given feature set and classifier.

Parameters:
featureSet -
classifier -
Method Detail

getConf

public double getConf(T object)
               throws java.lang.Exception
Computes the confidence that the given object belongs to the positive class according to the classifier.

Parameters:
object -
Returns:
the confidence score
Throws:
java.lang.Exception - if the classifier is unable to compute the confidence