edu.cmu.minorthird.classify.algorithms.svm
Class SVMClassifier

java.lang.Object
  extended by edu.cmu.minorthird.classify.algorithms.svm.SVMClassifier
All Implemented Interfaces:
Classifier, Visible, java.io.Serializable

public class SVMClassifier
extends java.lang.Object
implements Classifier, java.io.Serializable, Visible

SVMClassifier wrapps the prediction code from the libsvm library for binary or multi-class problems. A SVMClassifier must be built from a model, using the svm_model class from libsvm. This is best done by running the learner.

Note that due to the way libsvm computes probabilities you may get different predictions for the same instance if you turn on probabilities compared to when you leave it turned off. See the libsvm home page for more details.

Author:
qcm, Frank Lin
See Also:
Serialized Form

Constructor Summary
SVMClassifier(libsvm.svm_model model, ExampleSchema schema, FeatureFactory featureFactory)
           
 
Method Summary
 ClassLabel classification(Instance instance)
          Return a predicted type for the span, as a class label.
 java.lang.String explain(Instance instance)
          Return some string that 'explains' the classification
 Explanation getExplanation(Instance instance)
          Return an Explanation for the classification
 FeatureFactory getFeatureFactory()
           
 ExampleSchema getSchema()
           
 libsvm.svm_model getSVMModel()
           
 Viewer toGUI()
          GUI stuff
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVMClassifier

public SVMClassifier(libsvm.svm_model model,
                     ExampleSchema schema,
                     FeatureFactory featureFactory)
Method Detail

explain

public java.lang.String explain(Instance instance)
Description copied from interface: Classifier
Return some string that 'explains' the classification

Specified by:
explain in interface Classifier

getExplanation

public Explanation getExplanation(Instance instance)
Description copied from interface: Classifier
Return an Explanation for the classification

Specified by:
getExplanation in interface Classifier

getSVMModel

public libsvm.svm_model getSVMModel()

getSchema

public ExampleSchema getSchema()

getFeatureFactory

public FeatureFactory getFeatureFactory()

classification

public ClassLabel classification(Instance instance)
Description copied from interface: Classifier
Return a predicted type for the span, as a class label.

Specified by:
classification in interface Classifier

toGUI

public Viewer toGUI()
GUI stuff

Specified by:
toGUI in interface Visible