Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
The Waikato Environment for Knowledge Analysis (WEKA), a machine
learning workbench. This version represents the developer version, the
"bleeding edge" of development, you could say. New functionality gets added
to this version.
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
/*
* BVDecomposeSegCVSub.java
* Copyright (C) 2003 Paul Conilione
*
* Based on the class: BVDecompose.java by Len Trigg (1999)
*/
/*
* DEDICATION
*
* Paul Conilione would like to express his deep gratitude and appreciation
* to his Chinese Buddhist Taoist Master Sifu Chow Yuk Nen for the abilities
* and insight that he has been taught, which have allowed him to program in
* a clear and efficient manner.
*
* Master Sifu Chow Yuk Nen's Teachings are unique and precious. They are
* applicable to any field of human endeavour. Through his unique and powerful
* ability to skilfully apply Chinese Buddhist Teachings, people have achieved
* success in; Computing, chemical engineering, business, accounting, philosophy
* and more.
*
*/
package weka.classifiers;
import weka.core.Attribute;
import weka.core.Instance;
import weka.core.Instances;
import weka.core.Option;
import weka.core.OptionHandler;
import weka.core.RevisionHandler;
import weka.core.RevisionUtils;
import weka.core.TechnicalInformation;
import weka.core.TechnicalInformationHandler;
import weka.core.Utils;
import weka.core.TechnicalInformation.Field;
import weka.core.TechnicalInformation.Type;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.Reader;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Random;
import java.util.Vector;
/**
* This class performs Bias-Variance decomposion on any classifier using the sub-sampled cross-validation procedure as specified in (1).
* The Kohavi and Wolpert definition of bias and variance is specified in (2).
* The Webb definition of bias and variance is specified in (3).
*
* Geoffrey I. Webb, Paul Conilione (2002). Estimating bias and variance from data. School of Computer Science and Software Engineering, Victoria, Australia.
*
* 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.
*
* Geoffrey I. Webb (2000). MultiBoosting: A Technique for Combining Boosting and Wagging. Machine Learning. 40(2):159-196.
*
*
* BibTeX:
*
* @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 console
*
*
* Options after -- are passed to the designated sub-learner.
*
* @author Paul Conilione ([email protected])
* @version $Revision: 10141 $
*/
public class BVDecomposeSegCVSub
implements OptionHandler, TechnicalInformationHandler, RevisionHandler {
/** Debugging mode, gives extra output if true. */
protected boolean m_Debug;
/** An instantiated base classifier used for getting and testing options. */
protected Classifier m_Classifier = new weka.classifiers.rules.ZeroR();
/** The options to be passed to the base classifier. */
protected String [] m_ClassifierOptions;
/** The number of times an instance is classified*/
protected int m_ClassifyIterations;
/** The name of the data file used for the decomposition */
protected String m_DataFileName;
/** The index of the class attribute */
protected int m_ClassIndex = -1;
/** The random number seed */
protected int m_Seed = 1;
/** The calculated Kohavi & Wolpert bias (squared) */
protected double m_KWBias;
/** The calculated Kohavi & Wolpert variance */
protected double m_KWVariance;
/** The calculated Kohavi & Wolpert sigma */
protected double m_KWSigma;
/** The calculated Webb bias */
protected double m_WBias;
/** The calculated Webb variance */
protected double m_WVariance;
/** The error rate */
protected double m_Error;
/** The training set size */
protected int m_TrainSize;
/** Proportion of instances common between any two training sets. */
protected double m_P;
/**
* Returns a string describing this object
* @return a description of the classifier suitable for
* displaying in the explorer/experimenter gui
*/
public String globalInfo() {
return
"This class performs Bias-Variance decomposion on any classifier using the "
+ "sub-sampled cross-validation procedure as specified in (1).\n"
+ "The Kohavi and Wolpert definition of bias and variance is specified in (2).\n"
+ "The Webb definition of bias and variance is specified in (3).\n\n"
+ getTechnicalInformation().toString();
}
/**
* 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.
*
* @return the technical information about this class
*/
public TechnicalInformation getTechnicalInformation() {
TechnicalInformation result;
TechnicalInformation additional;
result = new TechnicalInformation(Type.MISC);
result.setValue(Field.AUTHOR, "Geoffrey I. Webb and Paul Conilione");
result.setValue(Field.YEAR, "2002");
result.setValue(Field.TITLE, "Estimating bias and variance from data");
result.setValue(Field.INSTITUTION, "Monash University");
result.setValue(Field.ADDRESS, "School of Computer Science and Software Engineering, Victoria, Australia");
result.setValue(Field.PDF, "http://www.csse.monash.edu.au/~webb/Files/WebbConilione04.pdf");
additional = result.add(Type.INPROCEEDINGS);
additional.setValue(Field.AUTHOR, "Ron Kohavi and David H. Wolpert");
additional.setValue(Field.YEAR, "1996");
additional.setValue(Field.TITLE, "Bias Plus Variance Decomposition for Zero-One Loss Functions");
additional.setValue(Field.BOOKTITLE, "Machine Learning: Proceedings of the Thirteenth International Conference");
additional.setValue(Field.PUBLISHER, "Morgan Kaufmann");
additional.setValue(Field.EDITOR, "Lorenza Saitta");
additional.setValue(Field.PAGES, "275-283");
additional.setValue(Field.PS, "http://robotics.stanford.edu/~ronnyk/biasVar.ps");
additional = result.add(Type.ARTICLE);
additional.setValue(Field.AUTHOR, "Geoffrey I. Webb");
additional.setValue(Field.YEAR, "2000");
additional.setValue(Field.TITLE, "MultiBoosting: A Technique for Combining Boosting and Wagging");
additional.setValue(Field.JOURNAL, "Machine Learning");
additional.setValue(Field.VOLUME, "40");
additional.setValue(Field.NUMBER, "2");
additional.setValue(Field.PAGES, "159-196");
return result;
}
/**
* Returns an enumeration describing the available options.
*
* @return an enumeration of all the available options.
*/
public Enumeration