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

Class weka.classifiers.AdaBoostM1

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

public class AdaBoostM1
extends DistributionClassifier
implements OptionHandler, WeightedInstancesHandler, Sourcable
Class for boosting a classifier using Freund & Schapire's Adaboost M1 method. For more information, see

Yoav Freund and Robert E. Schapire (1996). Experiments with a new boosting algorithm. Proc International Conference on Machine Learning, pages 148-156, Morgan Kaufmann, San Francisco.

Valid options are:

-D
Turn on debugging output.

-W classname
Specify the full class name of a classifier as the basis for boosting (required).

-I num
Set the number of boost iterations (default 10).

-P num
Set the percentage of weight mass used to build classifiers (default 100).

-Q
Use resampling instead of reweighting.

-S seed
Random number seed for resampling (default 1).

Options after -- are passed to the designated classifier.

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

Constructor Index

 o AdaBoostM1()
 

Method Index

 o buildClassifier(Instances)
Boosting method.
 o distributionForInstance(Instance)
Calculates the class membership probabilities for the given test instance.
 o getClassifier()
Get the classifier used as the classifier
 o getDebug()
Get whether debugging is turned on
 o getMaxIterations()
Get the maximum number of boost iterations
 o getOptions()
Gets the current settings of the Classifier.
 o getSeed()
Get seed for resampling.
 o getUseResampling()
Get whether resampling is turned on
 o getWeightThreshold()
Get the degree of weight thresholding
 o listOptions()
Returns an enumeration describing the available options
 o main(String[])
Main method for testing this class.
 o setClassifier(Classifier)
Set the classifier for boosting.
 o setDebug(boolean)
Set debugging mode
 o setMaxIterations(int)
Set the maximum number of boost iterations
 o setOptions(String[])
Parses a given list of options.
 o setSeed(int)
Set seed for resampling.
 o setUseResampling(boolean)
Set resampling mode
 o setWeightThreshold(int)
Set weight threshold
 o toSource(String)
Returns the boosted model as Java source code.
 o toString()
Returns description of the boosted classifier.

Constructor Detail

 o AdaBoostM1
public AdaBoostM1()

Method Detail

 o listOptions
public java.util.Enumeration listOptions()
          Returns an enumeration describing the available options
Returns:
an enumeration of all the available options
 o setOptions
public void setOptions(java.lang.String options[]) throws java.lang.Exception
          Parses a given list of options. Valid options are:

-D
Turn on debugging output.

-W classname
Specify the full class name of a classifier as the basis for boosting (required).

-I num
Set the number of boost iterations (default 10).

-P num
Set the percentage of weight mass used to build classifiers (default 100).

-Q
Use resampling instead of reweighting.

-S seed
Random number seed for resampling (default 1).

Options after -- are passed to the designated classifier.

Parameters:
options - the list of options as an array of strings
Throws:
java.lang.Exception - if an option is not supported
 o getOptions
public java.lang.String[] getOptions()
          Gets the current settings of the Classifier.
Returns:
an array of strings suitable for passing to setOptions
 o setClassifier
public void setClassifier(Classifier newClassifier)
          Set the classifier for boosting.
Parameters:
newClassifier - the Classifier to use.
 o getClassifier
public Classifier getClassifier()
          Get the classifier used as the classifier
Returns:
the classifier used as the classifier
 o setMaxIterations
public void setMaxIterations(int maxIterations)
          Set the maximum number of boost iterations
 o getMaxIterations
public int getMaxIterations()
          Get the maximum number of boost iterations
Returns:
the maximum number of boost iterations
 o setWeightThreshold
public void setWeightThreshold(int threshold)
          Set weight threshold
Parameters:
thresholding - the percentage of weight mass used for training
 o getWeightThreshold
public int getWeightThreshold()
          Get the degree of weight thresholding
Returns:
the percentage of weight mass used for training
 o setSeed
public void setSeed(int seed)
          Set seed for resampling.
Parameters:
seed - the seed for resampling
 o getSeed
public int getSeed()
          Get seed for resampling.
Returns:
the seed for resampling
 o setDebug
public void setDebug(boolean debug)
          Set debugging mode
Parameters:
debug - true if debug output should be printed
 o getDebug
public boolean getDebug()
          Get whether debugging is turned on
Returns:
true if debugging output is on
 o setUseResampling
public void setUseResampling(boolean r)
          Set resampling mode
Parameters:
resampling - true if resampling should be done
 o getUseResampling
public boolean getUseResampling()
          Get whether resampling is turned on
Returns:
true if resampling output is on
 o buildClassifier
public void buildClassifier(Instances data) throws java.lang.Exception
          Boosting method.
Parameters:
data - the training data to be used for generating the boosted classifier.
Throws:
java.lang.Exception - if the classifier could not be built 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 instance could not be classified successfully
Overrides:
distributionForInstance in class DistributionClassifier
 o toSource
public java.lang.String toSource(java.lang.String className) throws java.lang.Exception
          Returns the boosted model 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 description of the boosted classifier.
Returns:
description of the boosted 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