edu.cmu.minorthird.classify.algorithms.linear
Class NegativeBinomialClassifier

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

public class NegativeBinomialClassifier
extends BinaryClassifier
implements Visible, java.io.Serializable

A generative Model for word-counts based on the Negative-Binomial Distribution.

Author:
Edoardo Airoldi Date: Jul 12, 2004
See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.cmu.minorthird.classify.BinaryClassifier
classifierLearner
 
Constructor Summary
NegativeBinomialClassifier()
           
 
Method Summary
 java.lang.String explain(Instance instance)
          Justify inner product of Negative-Binomial Classifier and instance weights.
 java.util.Iterator<Feature> featureIterator()
           
 Explanation getExplanation(Instance instance)
          Return an Explanation for the classification
 double score(Instance instance)
          Inner product of PoissonClassifier and instance weights.
 void setPmsNeg(Feature f, java.util.SortedMap<java.lang.String,java.lang.Double> tmap)
          Store parameters for f|negative
 void setPmsPos(Feature f, java.util.SortedMap<java.lang.String,java.lang.Double> tmap)
          Store parameters for f|positive
 void setPriorNeg(double k, double n, double prior, double pseudoCounts)
          Set the prior for negative documents
 void setPriorPos(double k, double n, double prior, double pseudoCounts)
          Set the prior for positive documents
 void setScale(double value)
          Set the scale term for the NB classifier to value
 Viewer toGUI()
          Create a view of this object
 java.lang.String toString()
           
 
Methods inherited from class edu.cmu.minorthird.classify.BinaryClassifier
classification, getClassifierLearner, setClassifierLearner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NegativeBinomialClassifier

public NegativeBinomialClassifier()
Method Detail

score

public double score(Instance instance)
Inner product of PoissonClassifier and instance weights.

Specified by:
score in class BinaryClassifier

explain

public java.lang.String explain(Instance instance)
Justify inner product of Negative-Binomial Classifier and instance weights.

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

setScale

public void setScale(double value)
Set the scale term for the NB classifier to value


setPriorPos

public void setPriorPos(double k,
                        double n,
                        double prior,
                        double pseudoCounts)
Set the prior for positive documents


setPriorNeg

public void setPriorNeg(double k,
                        double n,
                        double prior,
                        double pseudoCounts)
Set the prior for negative documents


setPmsNeg

public void setPmsNeg(Feature f,
                      java.util.SortedMap<java.lang.String,java.lang.Double> tmap)
Store parameters for f|negative


setPmsPos

public void setPmsPos(Feature f,
                      java.util.SortedMap<java.lang.String,java.lang.Double> tmap)
Store parameters for f|positive


featureIterator

public java.util.Iterator<Feature> featureIterator()

toGUI

public Viewer toGUI()
Description copied from interface: Visible
Create a view of this object

Specified by:
toGUI in interface Visible

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object