se.lth.cs.nlp.nlputils.ml
Class ProbabilityClassifier<T>

java.lang.Object
  extended by se.lth.cs.nlp.nlputils.ml.Classifier<T>
      extended by se.lth.cs.nlp.nlputils.ml.ProbabilityClassifier<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LibSVMClassifier, NativeLibSVMClassifier

public abstract class ProbabilityClassifier<T>
extends Classifier<T>

A classifier that can compute posterior class probabilities.

Author:
Richard Johansson (richard@cs.lth.se)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class se.lth.cs.nlp.nlputils.ml.Classifier
extractor, list
 
Constructor Summary
ProbabilityClassifier()
           
 
Method Summary
abstract  void computeProbabilities(FeatureList features, double[] probs)
          Computes the posterior class probabilities given a feature list.
 int computeProbabilities(T item, double[] probs)
          Computes the posterior class probabilities given an item.
 
Methods inherited from class se.lth.cs.nlp.nlputils.ml.Classifier
classify, classify, classifyRestricted, setFeatureExtractor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProbabilityClassifier

public ProbabilityClassifier()
Method Detail

computeProbabilities

public int computeProbabilities(T item,
                                double[] probs)
Computes the posterior class probabilities given an item.

Parameters:
item - the item to classify.
probs - the array of doubles where the probabilities are written.
Returns:
the feature extraction status value.

computeProbabilities

public abstract void computeProbabilities(FeatureList features,
                                          double[] probs)
Computes the posterior class probabilities given a feature list.

Parameters:
features - the feature list.
probs - the array of doubles where the probabilities are written.