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

Class weka.classifiers.meta.StackingC

java.lang.Object
    |
    +----weka.classifiers.Classifier
            |
            +----weka.classifiers.DistributionClassifier
                    |
                    +----weka.classifiers.meta.StackingC

public class StackingC
extends DistributionClassifier
implements OptionHandler
Implements StackingC. For more information, see

Seewald A.K.: How to Make Stacking Better and Faster While Also Taking Care of an Unknown Weakness, in Sammut C., Hoffmann A. (eds.), Proceedings of the Nineteenth International Conference on Machine Learning (ICML 2002), Morgan Kaufmann Publishers, pp.554-561, 2002.

Valid options are:

-X num_folds
The number of folds for the cross-validation (default 10).

-S seed
Random number seed (default 1).

-B classifierstring
Classifierstring should contain the full class name of a base scheme followed by options to the classifier. (required, option should be used once for each classifier).

-M classifierstring
Classifierstring for the meta classifier. Same format as for base classifiers. Has to be a function classifier, defaults to Linear Regression as in the original paper.

Version:
$Revision: 1.1 $
Author:
Eibe Frank (eibe@cs.waikato.ac.nz)
Author:
Alexander K. Seewald (alex@seewald.at)

Constructor Index

 o StackingC()
 

Method Index

 o buildClassifier(Instances)
Buildclassifier selects a classifier from the set of classifiers by minimising error on the training data.
 o distributionForInstance(Instance)
Classifies a given instance using the stacked classifier.
 o getBaseClassifier(int)
Gets the specific classifier from the set of base classifiers.
 o getBaseClassifiers()
Gets the list of possible classifers to choose from.
 o getMetaClassifier()
Gets the meta classifier.
 o getNumFolds()
Gets the number of folds for the cross-validation.
 o getOptions()
Gets the current settings of the Classifier.
 o getSeed()
Gets the random number seed.
 o listOptions()
Returns an enumeration describing the available options.
 o main(String[])
Main method for testing this class.
 o setBaseClassifiers(Classifier[])
Sets the list of possible classifers to choose from.
 o setMetaClassifier(Classifier)
Adds meta classifier
 o setNumFolds(int)
Sets the number of folds for the cross-validation.
 o setOptions(String[])
Parses a given list of options.
 o setSeed(int)
Sets the seed for random number generation.
 o toString()
Output a representation of this classifier

Constructor Detail

 o StackingC
public StackingC()

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:

-X num_folds
The number of folds for the cross-validation (default 10).

-S seed
Random number seed (default 1).

-B classifierstring
Classifierstring should contain the full class name of a base scheme followed by options to the classifier. (required, option should be used once for each classifier).

-M classifierstring
Classifierstring for the meta classifier. Same format as for base classifiers. Must be a function classifier. Default: Linear Regression

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 setSeed
public void setSeed(int seed)
          Sets the seed for random number generation.
Parameters:
seed - the random number seed
 o getSeed
public int getSeed()
          Gets the random number seed.
Returns:
the random number seed
 o getNumFolds
public int getNumFolds()
          Gets the number of folds for the cross-validation.
Returns:
the number of folds for the cross-validation
 o setNumFolds
public void setNumFolds(int numFolds) throws java.lang.Exception
          Sets the number of folds for the cross-validation.
Parameters:
numFolds - the number of folds for the cross-validation
Throws:
java.lang.Exception - if parameter illegal
 o setBaseClassifiers
public void setBaseClassifiers(Classifier classifiers[])
          Sets the list of possible classifers to choose from.
Parameters:
classifiers - an array of classifiers with all options set.
 o getBaseClassifiers
public Classifier[] getBaseClassifiers()
          Gets the list of possible classifers to choose from.
Returns:
the array of Classifiers
 o getBaseClassifier
public Classifier getBaseClassifier(int index)
          Gets the specific classifier from the set of base classifiers.
Parameters:
index - the index of the classifier to retrieve
Returns:
the classifier
 o setMetaClassifier
public void setMetaClassifier(Classifier classifier)
          Adds meta classifier
Parameters:
classifier - the classifier with all options set.
 o getMetaClassifier
public Classifier getMetaClassifier()
          Gets the meta classifier.
Returns:
the meta classifier
 o buildClassifier
public void buildClassifier(Instances data) throws java.lang.Exception
          Buildclassifier selects a classifier from the set of classifiers by minimising error on the training data.
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
          Classifies a given instance using the stacked classifier.
Parameters:
instance - the instance to be classified
Throws:
java.lang.Exception - if instance could not be classified successfully
Overrides:
distributionForInstance in class DistributionClassifier
 o toString
public java.lang.String toString()
          Output a representation of this classifier
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 - should contain the following arguments: -t training file [-T test file] [-c class index]

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