|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weka.classifiers.Classifier | +--weka.classifiers.MultipleClassifiersCombiner | +--weka.classifiers.RandomizableMultipleClassifiersCombiner | +--weka.classifiers.meta.Stacking
Implements stacking. For more information, see
David H. Wolpert (1992). Stacked generalization. Neural Networks, 5:241-259, Pergamon Press.
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. (required)
Constructor Summary | |
Stacking()
|
Method Summary | |
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. |
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 |
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 |
Methods inherited from class weka.classifiers.RandomizableMultipleClassifiersCombiner |
getSeed, seedTipText, setSeed |
Methods inherited from class weka.classifiers.MultipleClassifiersCombiner |
classifiersTipText, getClassifier, getClassifiers, setClassifiers |
Methods inherited from class weka.classifiers.Classifier |
classifyInstance, debugTipText, forName, getDebug, makeCopies, setDebug |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Stacking()
Method Detail |
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableMultipleClassifiersCombiner
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-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. (default: weka.classifiers.rules.ZeroR)
setOptions
in interface OptionHandler
setOptions
in class RandomizableMultipleClassifiersCombiner
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class RandomizableMultipleClassifiersCombiner
public java.lang.String numFoldsTipText()
public int getNumFolds()
public void setNumFolds(int numFolds) throws java.lang.Exception
numFolds
- the number of folds for the cross-validation
java.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 void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
data
- 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 Classifier
instance
- the instance to be classified
java.lang.Exception
- if instance could not be classified
successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
argv
- should contain the following arguments:
-t training file [-T test file] [-c class index]
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2003 David Lindsay, Computer Learning Research Centre, Dept. Computer Science, Royal Holloway, University of London