public class Stacking extends RandomizableMultipleClassifiersCombiner implements TechnicalInformationHandler
@article{Wolpert1992,
author = {David H. Wolpert},
journal = {Neural Networks},
pages = {241-259},
publisher = {Pergamon Press},
title = {Stacked generalization},
volume = {5},
year = {1992}
}
Valid options are:
-M <scheme specification> Full name of meta classifier, followed by options. (default: "weka.classifiers.rules.Zero")
-X <number of folds> Sets the number of cross-validation folds.
-S <num> Random number seed. (default 1)
-B <classifier specification> Full class name of classifier to include, followed by scheme options. May be specified multiple times. (default: "weka.classifiers.rules.ZeroR")
-D If set, classifier is run in debug mode and may output additional info to the console
| Constructor and Description |
|---|
Stacking() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildClassifier(Instances data)
Buildclassifier selects a classifier from the set of classifiers
by minimising error on the training data.
|
double[] |
distributionForInstance(Instance instance)
Returns class probabilities.
|
Capabilities |
getCapabilities()
Returns combined capabilities of the base classifiers, i.e., the
capabilities all of them have in common.
|
Classifier |
getMetaClassifier()
Gets the meta classifier.
|
int |
getNumFolds()
Gets the number of folds for the cross-validation.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
metaClassifierTipText()
Returns the tip text for this property
|
java.lang.String |
numFoldsTipText()
Returns the tip text for this property
|
void |
setMetaClassifier(Classifier classifier)
Adds meta classifier
|
void |
setNumFolds(int numFolds)
Sets the number of folds for the cross-validation.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
Output a representation of this classifier
|
getSeed, seedTipText, setSeedclassifiersTipText, getClassifier, getClassifiers, setClassifiersclassifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebugpublic java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic java.util.Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class RandomizableMultipleClassifiersCombinerpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-M <scheme specification> Full name of meta classifier, followed by options. (default: "weka.classifiers.rules.Zero")
-X <number of folds> Sets the number of cross-validation folds.
-S <num> Random number seed. (default 1)
-B <classifier specification> Full class name of classifier to include, followed by scheme options. May be specified multiple times. (default: "weka.classifiers.rules.ZeroR")
-D If set, classifier is run in debug mode and may output additional info to the console
setOptions in interface OptionHandlersetOptions in class RandomizableMultipleClassifiersCombineroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class RandomizableMultipleClassifiersCombinerpublic java.lang.String numFoldsTipText()
public int getNumFolds()
public void setNumFolds(int numFolds)
throws java.lang.Exception
numFolds - the number of folds for the cross-validationjava.lang.Exception - if parameter illegalpublic java.lang.String metaClassifierTipText()
public void setMetaClassifier(Classifier classifier)
classifier - the classifier with all options set.public Classifier getMetaClassifier()
public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class MultipleClassifiersCombinerCapabilitiespublic void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier in class Classifierdata - the training data to be used for generating the
boosted classifier.java.lang.Exception - if the classifier could not be built successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance in class Classifierinstance - the instance to be classifiedjava.lang.Exception - if instance could not be classified
successfullypublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Classifierpublic static void main(java.lang.String[] argv)
argv - should contain the following arguments:
-t training file [-T test file] [-c class index]