edu.stanford.nlp.classify
Class SVMLightClassifier<L,F>

java.lang.Object
  extended by edu.stanford.nlp.classify.LinearClassifier<L,F>
      extended by edu.stanford.nlp.classify.SVMLightClassifier<L,F>
All Implemented Interfaces:
Classifier<L,F>, ProbabilisticClassifier<L,F>, RVFClassifier<L,F>, Serializable

public class SVMLightClassifier<L,F>
extends LinearClassifier<L,F>

This class represents a trained SVM Classifier. It is actually just a LinearClassifier, but it can have a Platt (sigmoid) model overlaying it for the purpose of producing meaningful probabilities.

Author:
Jenny Finkel, Sarah Spikes (sdspikes@cs.stanford.edu) (templatization)
See Also:
Serialized Form

Field Summary
 LinearClassifier<L,L> platt
           
 
Fields inherited from class edu.stanford.nlp.classify.LinearClassifier
intern, TEXT_SERIALIZATION_DELIMITER
 
Constructor Summary
SVMLightClassifier(ClassicCounter<Pair<F,L>> weightCounter, ClassicCounter<L> thresholds)
           
SVMLightClassifier(ClassicCounter<Pair<F,L>> weightCounter, ClassicCounter<L> thresholds, LinearClassifier<L,L> platt)
           
 
Method Summary
 Counter<L> logProbabilityOf(Datum<L,F> example)
          Returns a counter for the log probability of each of the classes looking at the the sum of e^v for each count v, should be 1 Note: Uses SloppyMath.logSum which isn't exact but isn't as offensively slow as doing a series of exponentials
 Counter<L> logProbabilityOf(RVFDatum<L,F> example)
          Returns a counter for the log probability of each of the classes looking at the the sum of e^v for each count v, should be 1 Note: Uses SloppyMath.logSum which isn't exact but isn't as offensively slow as doing a series of exponentials
 void setPlatt(LinearClassifier<L,L> platt)
           
 
Methods inherited from class edu.stanford.nlp.classify.LinearClassifier
adaptWeights, classOf, classOf, dump, dump, dumpSorted, experimentalClassOf, featureIndex, features, getFeatureCount, getFeatureCount, getFeatureCountLabelIndices, getLabelIndices, getTopFeatures, getTopFeatures, getTopFeaturesLabelIndices, justificationOf, justificationOf, justificationOf, justificationOf, justificationOf, justificationOf, justificationOf, labelIndex, labels, logProbabilityOf, probabilityOf, probabilityOf, probabilityOf, readClassifier, saveToFilename, scoreOf, scoreOf, scoresOf, scoresOf, scoresOf, scoresOf, setWeights, toAllWeightsString, toBiggestWeightFeaturesString, toDistributionString, toHistogramString, topFeaturesToString, toString, toString, totalSize, weight, weights, weightsAsMapOfCounters, writeClassifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

platt

public LinearClassifier<L,L> platt
Constructor Detail

SVMLightClassifier

public SVMLightClassifier(ClassicCounter<Pair<F,L>> weightCounter,
                          ClassicCounter<L> thresholds)

SVMLightClassifier

public SVMLightClassifier(ClassicCounter<Pair<F,L>> weightCounter,
                          ClassicCounter<L> thresholds,
                          LinearClassifier<L,L> platt)
Method Detail

setPlatt

public void setPlatt(LinearClassifier<L,L> platt)

logProbabilityOf

public Counter<L> logProbabilityOf(Datum<L,F> example)
Returns a counter for the log probability of each of the classes looking at the the sum of e^v for each count v, should be 1 Note: Uses SloppyMath.logSum which isn't exact but isn't as offensively slow as doing a series of exponentials

Specified by:
logProbabilityOf in interface ProbabilisticClassifier<L,F>
Overrides:
logProbabilityOf in class LinearClassifier<L,F>

logProbabilityOf

public Counter<L> logProbabilityOf(RVFDatum<L,F> example)
Returns a counter for the log probability of each of the classes looking at the the sum of e^v for each count v, should be 1 Note: Uses SloppyMath.logSum which isn't exact but isn't as offensively slow as doing a series of exponentials

Overrides:
logProbabilityOf in class LinearClassifier<L,F>


Stanford NLP Group