Package weka.classifiers
Class BVDecompose
java.lang.Object
weka.classifiers.BVDecompose
- All Implemented Interfaces:
- OptionHandler,- RevisionHandler,- TechnicalInformationHandler
public class BVDecompose
extends Object
implements OptionHandler, TechnicalInformationHandler, RevisionHandler
 Class for performing a Bias-Variance decomposition on any classifier using the method specified in:
 
Ron Kohavi, David H. Wolpert: Bias Plus Variance Decomposition for Zero-One Loss Functions. In: Machine Learning: Proceedings of the Thirteenth International Conference, 275-283, 1996. BibTeX:
Ron Kohavi, David H. Wolpert: Bias Plus Variance Decomposition for Zero-One Loss Functions. In: Machine Learning: Proceedings of the Thirteenth International Conference, 275-283, 1996. BibTeX:
 @inproceedings{Kohavi1996,
    author = {Ron Kohavi and David H. Wolpert},
    booktitle = {Machine Learning: Proceedings of the Thirteenth International Conference},
    editor = {Lorenza Saitta},
    pages = {275-283},
    publisher = {Morgan Kaufmann},
    title = {Bias Plus Variance Decomposition for Zero-One Loss Functions},
    year = {1996},
    PS = {http://robotics.stanford.edu/\~ronnyk/biasVar.ps}
 }
 
 
 
 
 Valid options are: 
 -c <class index> The index of the class attribute. (default last)
-t <name of arff file> The name of the arff file used for the decomposition.
-T <training pool size> The number of instances placed in the training pool. The remainder will be used for testing. (default 100)
-s <seed> The random number seed used.
-x <num> The number of training repetitions used. (default 50)
-D Turn on debugging output.
-W <classifier class name> Full class name of the learner used in the decomposition. eg: weka.classifiers.bayes.NaiveBayes
Options specific to learner weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the consoleOptions after -- are passed to the designated sub-learner.
- Version:
- $Revision: 10141 $
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz)
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidCarry out the bias-variance decompositiondoublegetBias()Get the calculated bias squaredGets the name of the classifier being analysedintGet the index (starting from 1) of the attribute used as the class.Get the name of the data file used for the decompositionbooleangetDebug()Gets whether debugging is turned ondoublegetError()Get the calculated error rateString[]Gets the current settings of the CheckClassifier.Returns the revision string.intgetSeed()Gets the random number seeddoublegetSigma()Get the calculated sigma squaredReturns 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.intGets the maximum number of boost iterationsintGet the number of instances in the training pool.doubleGet the calculated varianceReturns a string describing this objectReturns an enumeration describing the available options.static voidTest method for this classvoidsetClassifier(Classifier newClassifier) Set the classifiers being analysedvoidsetClassIndex(int classIndex) Sets index of attribute to discretize onvoidsetDataFileName(String dataFileName) Sets the name of the data file used for the decompositionvoidsetDebug(boolean debug) Sets debugging modevoidsetOptions(String[] options) Parses a given list of options.voidsetSeed(int seed) Sets the random number seedvoidsetTrainIterations(int trainIterations) Sets the maximum number of boost iterationsvoidsetTrainPoolSize(int numTrain) Set the number of instances in the training pool.toString()Returns description of the bias-variance decomposition results.
- 
Constructor Details- 
BVDecomposepublic BVDecompose()
 
- 
- 
Method Details- 
globalInfoReturns a string describing this object- Returns:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
 
- 
getTechnicalInformationReturns 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.- Specified by:
- getTechnicalInformationin interface- TechnicalInformationHandler
- Returns:
- the technical information about this class
 
- 
listOptionsReturns an enumeration describing the available options.- Specified by:
- listOptionsin interface- OptionHandler
- Returns:
- an enumeration of all the available options.
 
- 
setOptionsParses a given list of options. Valid options are:-c <class index> The index of the class attribute. (default last) -t <name of arff file> The name of the arff file used for the decomposition. -T <training pool size> The number of instances placed in the training pool. The remainder will be used for testing. (default 100) -s <seed> The random number seed used. -x <num> The number of training repetitions used. (default 50) -D Turn on debugging output. -W <classifier class name> Full class name of the learner used in the decomposition. eg: weka.classifiers.bayes.NaiveBayes Options specific to learner weka.classifiers.rules.ZeroR: -D If set, classifier is run in debug mode and may output additional info to the console Options after -- are passed to the designated sub-learner.- Specified by:
- setOptionsin interface- OptionHandler
- Parameters:
- options- the list of options as an array of strings
- Throws:
- Exception- if an option is not supported
 
- 
getOptionsGets the current settings of the CheckClassifier.- Specified by:
- getOptionsin interface- OptionHandler
- Returns:
- an array of strings suitable for passing to setOptions
 
- 
getTrainPoolSizepublic int getTrainPoolSize()Get the number of instances in the training pool.- Returns:
- number of instances in the training pool.
 
- 
setTrainPoolSizepublic void setTrainPoolSize(int numTrain) Set the number of instances in the training pool.- Parameters:
- numTrain- number of instances in the training pool.
 
- 
setClassifierSet the classifiers being analysed- Parameters:
- newClassifier- the Classifier to use.
 
- 
getClassifierGets the name of the classifier being analysed- Returns:
- the classifier being analysed.
 
- 
setDebugpublic void setDebug(boolean debug) Sets debugging mode- Parameters:
- debug- true if debug output should be printed
 
- 
getDebugpublic boolean getDebug()Gets whether debugging is turned on- Returns:
- true if debugging output is on
 
- 
setSeedpublic void setSeed(int seed) Sets the random number seed- Parameters:
- seed- the random number seed
 
- 
getSeedpublic int getSeed()Gets the random number seed- Returns:
- the random number seed
 
- 
setTrainIterationspublic void setTrainIterations(int trainIterations) Sets the maximum number of boost iterations- Parameters:
- trainIterations- the number of boost iterations
 
- 
getTrainIterationspublic int getTrainIterations()Gets the maximum number of boost iterations- Returns:
- the maximum number of boost iterations
 
- 
setDataFileNameSets the name of the data file used for the decomposition- Parameters:
- dataFileName- the data file to use
 
- 
getDataFileNameGet the name of the data file used for the decomposition- Returns:
- the name of the data file
 
- 
getClassIndexpublic int getClassIndex()Get the index (starting from 1) of the attribute used as the class.- Returns:
- the index of the class attribute
 
- 
setClassIndexpublic void setClassIndex(int classIndex) Sets index of attribute to discretize on- Parameters:
- classIndex- the index (starting from 1) of the class attribute
 
- 
getBiaspublic double getBias()Get the calculated bias squared- Returns:
- the bias squared
 
- 
getVariancepublic double getVariance()Get the calculated variance- Returns:
- the variance
 
- 
getSigmapublic double getSigma()Get the calculated sigma squared- Returns:
- the sigma squared
 
- 
getErrorpublic double getError()Get the calculated error rate- Returns:
- the error rate
 
- 
decomposeCarry out the bias-variance decomposition- Throws:
- Exception- if the decomposition couldn't be carried out
 
- 
toStringReturns description of the bias-variance decomposition results.
- 
getRevisionReturns the revision string.- Specified by:
- getRevisionin interface- RevisionHandler
- Returns:
- the revision
 
- 
mainTest method for this class- Parameters:
- args- the command line arguments
 
 
-