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)
-
DecisionStump()
-
-
buildClassifier(Instances)
- Generates the classifier.
-
distributionForInstance(Instance)
- Calculates the class membership probabilities for the given test instance.
-
main(String[])
- Main method for testing this class.
-
toSource(String)
- Returns the decision tree as Java source code.
-
toString()
- Returns a description of the classifier.
DecisionStump
public DecisionStump()
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
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
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
toString
public String toString()
- Returns a description of the classifier.
- Returns:
- a description of the classifier as a string.
- Overrides:
- toString in class Object
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