edu.stanford.nlp.classification.internal
Interface IClassifier


public interface IClassifier

This is the interface for internal (primitive type) classifiers. Implementing objects are typically vended by IClassifierFactory objects and represent a trained classifier. The assumption is that all data points are represented by double arrays and that there are fixed number of classes, each represented by an integer from 0 to the number of classes. The maps to and from these primitive representations are maintained by a wrapper class. If these restrictions are not appropriate for a given task, Classifier should be implemented directly. Usage: classOf returns a best class, breaking ties arbitrarily, while scoresOf produces a score for each class. A typical interpretation would be that the scores are conditional probabilities and that the class one with a highest conditional likelihood.

Since:
1.0

Method Summary
 int classOf(double[] data)
          The internal classification function.
 double[] scoresOf(double[] data)
          The internal scoring function.
 

Method Detail

classOf

public int classOf(double[] data)
The internal classification function. Returns the best class for the input vector.

Parameters:
data - a data point, as a double array of feature values
Returns:
the int corresponding to a best class

scoresOf

public double[] scoresOf(double[] data)
The internal scoring function. Returns an array of the scores assigned to each class by this classifier.

Parameters:
data - a data point, as a double array of feature values
Returns:
a double array of the scores for each class


Stanford NLP Group