mark.nlp.weka
Class Sahami

java.lang.Object
  |
  +--weka.classifiers.Classifier
        |
        +--weka.classifiers.DistributionClassifier
              |
              +--mark.nlp.weka.Sahami
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, weka.core.WeightedInstancesHandler

public class Sahami
extends weka.classifiers.DistributionClassifier
implements weka.core.WeightedInstancesHandler

See Also:
Serialized Form

Constructor Summary
Sahami()
           
 
Method Summary
 void buildClassifier(weka.core.Instances instances)
          Trains the classifier.
static void checkForUnderflow(double[] probs)
           
 double[] distributionForInstance(weka.core.Instance instance)
           
static void main(java.lang.String[] argv)
           
protected static double[] toDoubleArray(weka.core.Instance instance)
          Converts a weka instance into a double array.
 
Methods inherited from class weka.classifiers.DistributionClassifier
classifyInstance
 
Methods inherited from class weka.classifiers.Classifier
forName, makeCopies
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sahami

public Sahami()
Method Detail

toDoubleArray

protected static double[] toDoubleArray(weka.core.Instance instance)
                                 throws java.lang.Exception
Converts a weka instance into a double array. The array will not have the category.

java.lang.Exception

buildClassifier

public void buildClassifier(weka.core.Instances instances)
                     throws java.lang.Exception
Trains the classifier. Overrides version in weka.classifier.Classifier. Based on work by Sahami.

Specified by:
buildClassifier in class weka.classifiers.Classifier
java.lang.Exception

checkForUnderflow

public static void checkForUnderflow(double[] probs)

distributionForInstance

public double[] distributionForInstance(weka.core.Instance instance)
                                 throws java.lang.Exception
Specified by:
distributionForInstance in class weka.classifiers.DistributionClassifier
java.lang.Exception

main

public static void main(java.lang.String[] argv)