Class InputSmearing

  • All Implemented Interfaces:
    Serializable, Cloneable, weka.classifiers.Classifier, weka.core.AdditionalMeasureProducer, weka.core.Aggregateable<weka.classifiers.meta.Bagging>, weka.core.BatchPredictor, weka.core.CapabilitiesHandler, weka.core.CapabilitiesIgnorer, weka.core.CommandlineRunnable, weka.core.OptionHandler, weka.core.PartitionGenerator, weka.core.Randomizable, weka.core.RevisionHandler, weka.core.TechnicalInformationHandler, weka.core.WeightedInstancesHandler

    public class InputSmearing
    extends weka.classifiers.meta.Bagging
    Extended version of weka.classifiers.meta.Bagging, which allows input smearing of numeric attributes.
    Class for bagging a classifier to reduce variance. Can do classification and regression depending on the base learner.

    For more information, see

    Leo Breiman (1996). Bagging predictors. Machine Learning. 24(2):123-140.

    Frank, Eibe, Pfahringer, Bernhard: Improving on Bagging with Input Smearing. In Ng, Wee-Keong and Kitsuregawa, Masaru and Li, Jianzhong and Chang, Kuiyu, editors, Advances in Knowledge Discovery and Data Mining, 97-106, 2006.

    BibTeX:

     @article{Breiman1996,
        author = {Leo Breiman},
        journal = {Machine Learning},
        number = {2},
        pages = {123-140},
        title = {Bagging predictors},
        volume = {24},
        year = {1996}
     }
     
     @incollection{Frank2006,
        author = {Frank, Eibe and Pfahringer, Bernhard},
        booktitle = {Advances in Knowledge Discovery and Data Mining},
        editor = {Ng, Wee-Keong and Kitsuregawa, Masaru and Li, Jianzhong and Chang, Kuiyu},
        pages = {97-106},
        publisher = {Springer Berlin Heidelberg},
        series = {Lecture Notes in Computer Science},
        title = {Improving on Bagging with Input Smearing},
        volume = {3918},
        year = {2006},
        ISBN = {978-3-540-33206-0},
        URL = {http://dx.doi.org/10.1007/11731139_14}
     }
     

    Valid options are:

     -stddev <number>
      The multiplier for the standard deviation of a numeric attribute
      to use for performing the smearing (default 1.0)
     -P
      Size of each bag, as a percentage of the
      training set size. (default 100)
     -O
      Calculate the out of bag error.
     -represent-copies-using-weights
      Represent copies of instances using weights rather than explicitly.
     -S <num>
      Random number seed.
      (default 1)
     -num-slots <num>
      Number of execution slots.
      (default 1 - i.e. no parallelism)
      (use 0 to auto-detect number of cores)
     -I <num>
      Number of iterations.
      (default 10)
     -W
      Full name of base classifier.
      (default: weka.classifiers.trees.REPTree)
     -output-debug-info
      If set, classifier is run in debug mode and
      may output additional info to the console
     -do-not-check-capabilities
      If set, classifier capabilities are not checked before classifier is built
      (use with caution).
     
     Options specific to classifier weka.classifiers.trees.REPTree:
     
     -M <minimum number of instances>
      Set minimum number of instances per leaf (default 2).
     -V <minimum variance for split>
      Set minimum numeric class variance proportion
      of train variance for split (default 1e-3).
     -N <number of folds>
      Number of folds for reduced error pruning (default 3).
     -S <seed>
      Seed for random data shuffling (default 1).
     -P
      No pruning.
     -L
      Maximum tree depth (default -1, no maximum)
     -I
      Initial class value count (default 0)
     -R
      Spread initial count over all class values (i.e. don't use 1 per value)
     -output-debug-info
      If set, classifier is run in debug mode and
      may output additional info to the console
     -do-not-check-capabilities
      If set, classifier capabilities are not checked before classifier is built
      (use with caution).
    Options after -- are passed to the designated classifier.

    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz), Eibe Frank (eibe at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double m_StdDev
      the standard deviation multiplier to use.
      • Fields inherited from class weka.classifiers.meta.Bagging

        m_BagSizePercent, m_CalcOutOfBag, m_classifiersCache, m_data, m_inBag, m_OutOfBagEvaluationObject, m_random, m_RepresentUsingWeights
      • Fields inherited from class weka.classifiers.RandomizableParallelIteratedSingleClassifierEnhancer

        m_Seed
      • Fields inherited from class weka.classifiers.ParallelIteratedSingleClassifierEnhancer

        m_numExecutionSlots
      • Fields inherited from class weka.classifiers.IteratedSingleClassifierEnhancer

        m_Classifiers, m_NumIterations
      • Fields inherited from class weka.classifiers.SingleClassifierEnhancer

        m_Classifier
      • Fields inherited from class weka.classifiers.AbstractClassifier

        BATCH_SIZE_DEFAULT, m_BatchSize, m_Debug, m_DoNotCheckCapabilities, m_numDecimalPlaces, NUM_DECIMAL_PLACES_DEFAULT
    • Constructor Summary

      Constructors 
      Constructor Description
      InputSmearing()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String[] getOptions()
      Gets the current settings of the Classifier.
      String getRevision()
      Returns the revision string.
      double getStdDev()
      Gets the multiplier for the standard deviation to use for input smearing.
      weka.core.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.
      protected weka.core.Instances getTrainingSet​(int iteration)
      Returns a training set for a particular iteration.
      String globalInfo()
      Returns a string describing classifier.
      Enumeration<weka.core.Option> listOptions()
      Returns an enumeration describing the available options.
      static void main​(String[] args)
      Main method for testing this class.
      void setOptions​(String[] options)
      Parses a given list of options.
      void setStdDev​(double value)
      Sets the multiplier for the standard deviation to use for input smearing.
      String stdDevTipText()
      Returns the tip text for this property
      • Methods inherited from class weka.classifiers.meta.Bagging

        aggregate, bagSizePercentTipText, batchSizeTipText, buildClassifier, calcOutOfBagTipText, defaultClassifierString, distributionForInstance, distributionsForInstances, enumerateMeasures, finalizeAggregation, generatePartition, getBagSizePercent, getBatchSize, getCalcOutOfBag, getMeasure, getMembershipValues, getOutOfBagEvaluationObject, getOutputOutOfBagComplexityStatistics, getPrintClassifiers, getRepresentCopiesUsingWeights, getStoreOutOfBagPredictions, implementsMoreEfficientBatchPrediction, measureOutOfBagError, numElements, outputOutOfBagComplexityStatisticsTipText, printClassifiersTipText, representCopiesUsingWeightsTipText, setBagSizePercent, setBatchSize, setCalcOutOfBag, setOutputOutOfBagComplexityStatistics, setPrintClassifiers, setRepresentCopiesUsingWeights, setStoreOutOfBagPredictions, storeOutOfBagPredictionsTipText, toString
      • Methods inherited from class weka.classifiers.RandomizableParallelIteratedSingleClassifierEnhancer

        getSeed, seedTipText, setSeed
      • Methods inherited from class weka.classifiers.ParallelIteratedSingleClassifierEnhancer

        buildClassifiers, getNumExecutionSlots, numExecutionSlotsTipText, setNumExecutionSlots
      • Methods inherited from class weka.classifiers.IteratedSingleClassifierEnhancer

        defaultNumberOfIterations, getNumIterations, numIterationsTipText, setNumIterations
      • Methods inherited from class weka.classifiers.SingleClassifierEnhancer

        classifierTipText, defaultClassifierOptions, getCapabilities, getClassifier, getClassifierSpec, postExecution, preExecution, setClassifier
      • Methods inherited from class weka.classifiers.AbstractClassifier

        classifyInstance, debugTipText, doNotCheckCapabilitiesTipText, forName, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
      • Methods inherited from interface weka.core.CapabilitiesHandler

        getCapabilities
    • Field Detail

      • m_StdDev

        protected double m_StdDev
        the standard deviation multiplier to use.
    • Constructor Detail

      • InputSmearing

        public InputSmearing()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing classifier.
        Overrides:
        globalInfo in class weka.classifiers.meta.Bagging
        Returns:
        a description suitable for displaying in the explorer/experimenter gui
      • getTechnicalInformation

        public weka.core.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.
        Specified by:
        getTechnicalInformation in interface weka.core.TechnicalInformationHandler
        Overrides:
        getTechnicalInformation in class weka.classifiers.meta.Bagging
        Returns:
        the technical information about this class
      • listOptions

        public Enumeration<weka.core.Option> listOptions()
        Returns an enumeration describing the available options.
        Specified by:
        listOptions in interface weka.core.OptionHandler
        Overrides:
        listOptions in class weka.classifiers.meta.Bagging
        Returns:
        an enumeration of all the available options.
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Parses a given list of options.
        Specified by:
        setOptions in interface weka.core.OptionHandler
        Overrides:
        setOptions in class weka.classifiers.meta.Bagging
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported
      • getOptions

        public String[] getOptions()
        Gets the current settings of the Classifier.
        Specified by:
        getOptions in interface weka.core.OptionHandler
        Overrides:
        getOptions in class weka.classifiers.meta.Bagging
        Returns:
        an array of strings suitable for passing to setOptions
      • getStdDev

        public double getStdDev()
        Gets the multiplier for the standard deviation to use for input smearing.
        Returns:
        the multiplier
      • setStdDev

        public void setStdDev​(double value)
        Sets the multiplier for the standard deviation to use for input smearing.
        Parameters:
        value - the multiplier
      • stdDevTipText

        public String stdDevTipText()
        Returns the tip text for this property
        Returns:
        tip text for this property suitable for displaying in the explorer/experimenter gui
      • getTrainingSet

        protected weka.core.Instances getTrainingSet​(int iteration)
                                              throws Exception
        Returns a training set for a particular iteration.
        Overrides:
        getTrainingSet in class weka.classifiers.meta.Bagging
        Parameters:
        iteration - the number of the iteration for the requested training set.
        Returns:
        the training set for the supplied iteration number
        Throws:
        Exception - if something goes wrong when generating a training set.
      • getRevision

        public String getRevision()
        Returns the revision string.
        Specified by:
        getRevision in interface weka.core.RevisionHandler
        Overrides:
        getRevision in class weka.classifiers.meta.Bagging
        Returns:
        the revision
      • main

        public static void main​(String[] args)
        Main method for testing this class.
        Parameters:
        args - the options