All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home

Class weka.classifiers.DecisionStump

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.DistributionClassifier
                    |
                    +----weka.classifiers.DecisionStump

public class DecisionStump
extends DistributionClassifier
implements WeightedInstancesHandler, Sourcable
Class for building and using a decision stump. Usually used in conjunction with a boosting algorithm. Typical usage:

java weka.classifiers.LogitBoost -I 100 -W weka.classifiers.DecisionStump -t training_data

Version:
$Revision: 1.12 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)

Constructor Index

 o DecisionStump()
 

Method Index

 o buildClassifier(Instances)
Generates the classifier.
 o distributionForInstance(Instance)
Calculates the class membership probabilities for the given test instance.
 o main(String[])
Main method for testing this class.
 o toSource(String)
Returns the decision tree as Java source code.
 o toString()
Returns a description of the classifier.

Constructor Detail

 o DecisionStump
public DecisionStump()

Method Detail

 o buildClassifier
public void buildClassifier(Instances instances) throws java.lang.Exception
          Generates the classifier.
Parameters:
instances - set of instances serving as training data
Throws:
java.lang.Exception - if the classifier has not been generated successfully
Overrides:
buildClassifier in class Classifier
 o distributionForInstance
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
          Calculates the class membership probabilities for the given test instance.
Parameters:
instance - the instance to be classified
Returns:
predicted class probability distribution
Throws:
java.lang.Exception - if distribution can't be computed
Overrides:
distributionForInstance in class DistributionClassifier
 o toSource
public java.lang.String toSource(java.lang.String className) throws java.lang.Exception
          Returns the decision tree as Java source code.
Returns:
the tree as Java source code
Throws:
java.lang.Exception - if something goes wrong
 o toString
public java.lang.String toString()
          Returns a description of the classifier.
Returns:
a description of the classifier as a string.
Overrides:
toString in class java.lang.Object
 o main
public static void main(java.lang.String argv[])
          Main method for testing this class.
Parameters:
argv - the options

All Packages  Class Hierarchy  This Package  Previous  Next  Index  WEKA's home