se.lth.cs.nlp.nlputils.ml.glue
Class LibSVMClassifier<T>

java.lang.Object
  extended by se.lth.cs.nlp.nlputils.ml.Classifier<T>
      extended by se.lth.cs.nlp.nlputils.ml.ProbabilityClassifier<T>
          extended by se.lth.cs.nlp.nlputils.ml.glue.LibSVMClassifier<T>
All Implemented Interfaces:
Serializable

 class LibSVMClassifier<T>
extends ProbabilityClassifier<T>

Author:
Richard Johansson (richard@cs.lth.se)

Field Summary
 
Fields inherited from class se.lth.cs.nlp.nlputils.ml.Classifier
extractor, list
 
Constructor Summary
LibSVMClassifier(String modelName, NumericEncoding enc)
           
 
Method Summary
 Object classify(FeatureList features)
          Performs a classification given a feature list.
 Object classifyRestricted(FeatureList features, Collection classes)
          Optional method that makes sure that restricts the range of the output value.
 void computeProbabilities(FeatureList features, double[] probs)
          Computes the posterior class probabilities given a feature list.
 
Methods inherited from class se.lth.cs.nlp.nlputils.ml.ProbabilityClassifier
computeProbabilities
 
Methods inherited from class se.lth.cs.nlp.nlputils.ml.Classifier
classify, setFeatureExtractor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LibSVMClassifier

LibSVMClassifier(String modelName,
                 NumericEncoding enc)
           throws IOException
Throws:
IOException
Method Detail

classify

public Object classify(FeatureList features)
Description copied from class: Classifier
Performs a classification given a feature list.

Specified by:
classify in class Classifier<T>
Parameters:
features - the feature list.
Returns:
the result of the classification.

computeProbabilities

public void computeProbabilities(FeatureList features,
                                 double[] probs)
Description copied from class: ProbabilityClassifier
Computes the posterior class probabilities given a feature list.

Specified by:
computeProbabilities in class ProbabilityClassifier<T>
Parameters:
features - the feature list.
probs - the array of doubles where the probabilities are written.

classifyRestricted

public Object classifyRestricted(FeatureList features,
                                 Collection classes)
Description copied from class: Classifier
Optional method that makes sure that restricts the range of the output value.

Overrides:
classifyRestricted in class Classifier<T>
Parameters:
features - the feature list.
classes - a collection of allowed classes.
Returns:
the result of the classification.