public class BVDecomposeSegCVSub extends Object implements OptionHandler, TechnicalInformationHandler, RevisionHandler
@misc{Webb2002, address = {School of Computer Science and Software Engineering, Victoria, Australia}, author = {Geoffrey I. Webb and Paul Conilione}, institution = {Monash University}, title = {Estimating bias and variance from data}, year = {2002}, PDF = {http://www.csse.monash.edu.au/\~webb/Files/WebbConilione04.pdf} } @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} } @article{Webb2000, author = {Geoffrey I. Webb}, journal = {Machine Learning}, number = {2}, pages = {159-196}, title = {MultiBoosting: A Technique for Combining Boosting and Wagging}, volume = {40}, year = {2000} }Valid options are:
-c <class index> The index of the class attribute. (default last)
-D Turn on debugging output.
-l <num> The number of times each instance is classified. (default 10)
-p <proportion of objects in common> The average proportion of instances common between any two training sets
-s <seed> The random number seed used.
-t <name of arff file> The name of the arff file used for the decomposition.
-T <number of instances in training set> The number of instances in the training set.
-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.
Modifier and Type | Field and Description |
---|---|
protected Classifier |
m_Classifier
An instantiated base classifier used for getting and testing options.
|
protected String[] |
m_ClassifierOptions
The options to be passed to the base classifier.
|
protected int |
m_ClassifyIterations
The number of times an instance is classified
|
protected int |
m_ClassIndex
The index of the class attribute
|
protected String |
m_DataFileName
The name of the data file used for the decomposition
|
protected boolean |
m_Debug
Debugging mode, gives extra output if true.
|
protected double |
m_Error
The error rate
|
protected double |
m_KWBias
The calculated Kohavi & Wolpert bias (squared)
|
protected double |
m_KWSigma
The calculated Kohavi & Wolpert sigma
|
protected double |
m_KWVariance
The calculated Kohavi & Wolpert variance
|
protected double |
m_P
Proportion of instances common between any two training sets.
|
protected int |
m_Seed
The random number seed
|
protected int |
m_TrainSize
The training set size
|
protected double |
m_WBias
The calculated Webb bias
|
protected double |
m_WVariance
The calculated Webb variance
|
Constructor and Description |
---|
BVDecomposeSegCVSub() |
Modifier and Type | Method and Description |
---|---|
void |
decompose()
Carry out the bias-variance decomposition using the sub-sampled cross-validation method.
|
Vector |
findCentralTendencies(double[] predProbs)
Finds the central tendency, given the classifications for an instance.
|
Classifier |
getClassifier()
Gets the name of the classifier being analysed
|
int |
getClassifyIterations()
Gets the number of times an instance is classified
|
int |
getClassIndex()
Get the index (starting from 1) of the attribute used as the class.
|
String |
getDataFileName()
Get the name of the data file used for the decomposition
|
boolean |
getDebug()
Gets whether debugging is turned on
|
double |
getError()
Get the calculated error rate
|
double |
getKWBias()
Get the calculated bias squared according to the Kohavi and Wolpert definition
|
double |
getKWSigma()
Get the calculated sigma according to the Kohavi and Wolpert definition
|
double |
getKWVariance()
Get the calculated variance according to the Kohavi and Wolpert definition
|
String[] |
getOptions()
Gets the current settings of the CheckClassifier.
|
double |
getP()
Get the proportion of instances that are common between two training sets.
|
String |
getRevision()
Returns the revision string.
|
int |
getSeed()
Gets the random number seed
|
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.
|
int |
getTrainSize()
Get the training size
|
double |
getWBias()
Get the calculated bias according to the Webb definition
|
double |
getWVariance()
Get the calculated variance according to the Webb definition
|
String |
globalInfo()
Returns a string describing this object
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] args)
Test method for this class
|
void |
randomize(int[] index,
Random random)
Accepts an array of ints and randomises the values in the array, using the
random seed.
|
void |
setClassifier(Classifier newClassifier)
Set the classifiers being analysed
|
void |
setClassifyIterations(int classifyIterations)
Sets the number of times an instance is classified
|
void |
setClassIndex(int classIndex)
Sets index of attribute to discretize on
|
void |
setDataFileName(String dataFileName)
Sets the name of the dataset file.
|
void |
setDebug(boolean debug)
Sets debugging mode
|
void |
setOptions(String[] options)
Sets the OptionHandler's options using the given list.
|
void |
setP(double proportion)
Set the proportion of instances that are common between two training sets
used to train a classifier.
|
void |
setSeed(int seed)
Sets the random number seed
|
void |
setTrainSize(int size)
Set the training size.
|
String |
toString()
Returns description of the bias-variance decomposition results.
|
protected boolean m_Debug
protected Classifier m_Classifier
protected String[] m_ClassifierOptions
protected int m_ClassifyIterations
protected String m_DataFileName
protected int m_ClassIndex
protected int m_Seed
protected double m_KWBias
protected double m_KWVariance
protected double m_KWSigma
protected double m_WBias
protected double m_WVariance
protected double m_Error
protected int m_TrainSize
protected double m_P
public String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(String[] options) throws Exception
-c <class index> The index of the class attribute. (default last)
-D Turn on debugging output.
-l <num> The number of times each instance is classified. (default 10)
-p <proportion of objects in common> The average proportion of instances common between any two training sets
-s <seed> The random number seed used.
-t <name of arff file> The name of the arff file used for the decomposition.
-T <number of instances in training set> The number of instances in the training set.
-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
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsException
- if an option is not supportedpublic String[] getOptions()
getOptions
in interface OptionHandler
public void setClassifier(Classifier newClassifier)
newClassifier
- the Classifier to use.public Classifier getClassifier()
public void setDebug(boolean debug)
debug
- true if debug output should be printedpublic boolean getDebug()
public void setSeed(int seed)
seed
- the random number seedpublic int getSeed()
public void setClassifyIterations(int classifyIterations)
classifyIterations
- number of times an instance is classifiedpublic int getClassifyIterations()
public void setDataFileName(String dataFileName)
dataFileName
- name of dataset file.public String getDataFileName()
public int getClassIndex()
public void setClassIndex(int classIndex)
classIndex
- the index (starting from 1) of the class attributepublic double getKWBias()
public double getWBias()
public double getKWVariance()
public double getWVariance()
public double getKWSigma()
public void setTrainSize(int size)
size
- the size of the training setpublic int getTrainSize()
public void setP(double proportion)
proportion
- the proportion of instances that are common between training
sets.public double getP()
public double getError()
public void decompose() throws Exception
Exception
- if the decomposition couldn't be carried outpublic Vector findCentralTendencies(double[] predProbs)
For example, instance 'x' may be classified out of 3 classes y = {1, 2, 3}, so if x is classified 10 times, and is classified as follows, '1' = 2 times, '2' = 5 times and '3' = 3 times. Then the central tendency is '2'.
However, it is important to note that this method returns a list of all classes that have the highest number of classifications. In cases where there are several classes with the largest number of classifications, then all of these classes are returned. For example if 'x' is classified '1' = 4 times, '2' = 4 times and '3' = 2 times. Then '1' and '2' are returned.
predProbs
- the array of classifications for a single instance.public String toString()
public String getRevision()
getRevision
in interface RevisionHandler
public static void main(String[] args)
args
- the command line argumentspublic final void randomize(int[] index, Random random)
index
- is the array of integersrandom
- is the Random seed.Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.