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.8 $
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.

Constructors

 o DecisionStump
 public DecisionStump()

Methods

 o buildClassifier
 public void buildClassifier(Instances instances) throws Exception
Generates the classifier.

Parameters:
instances - set of instances serving as training data
Throws: Exception
if the classifier has not been generated successfully
Overrides:
buildClassifier in class Classifier
 o distributionForInstance
 public double[] distributionForInstance(Instance instance) throws Exception
Calculates the class membership probabilities for the given test instance.

Parameters:
instance - the instance to be classified
Returns:
predicted class probability distribution
Throws: Exception
if distribution can't be computed
Overrides:
distributionForInstance in class DistributionClassifier
 o toSource
 public String toSource(String className) throws Exception
Returns the decision tree as Java source code.

Returns:
the tree as Java source code
Throws: Exception
if something goes wrong
 o toString
 public String toString()
Returns a description of the classifier.

Returns:
a description of the classifier as a string.
Overrides:
toString in class Object
 o main
 public static void main(String argv[])
Main method for testing this class.

Parameters:
argv - the options

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