Class AdditiveRegression

    • Constructor Detail

      • AdditiveRegression

        public AdditiveRegression()
        Default constructor specifying DecisionStump as the classifier
      • AdditiveRegression

        public AdditiveRegression​(Classifier classifier)
        Constructor which takes base classifier as argument.
        Parameters:
        classifier - the base classifier to use
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing this attribute evaluator
        Returns:
        a description of the evaluator suitable for displaying in the explorer/experimenter gui
      • getTechnicalInformation

        public 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 TechnicalInformationHandler
        Returns:
        the technical information about this class
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Parses a given list of options.

        Valid options are:

         -S
          Specify shrinkage rate. (default = 1.0, ie. no shrinkage)
         
         -I <num>
          Number of iterations.
          (default 10)
         -A
          Minimize absolute error instead of squared error (assumes that base learner minimizes absolute error).
          
         
         -D
          If set, classifier is run in debug mode and
          may output additional info to the console
         -W
          Full name of base classifier.
          (default: weka.classifiers.trees.DecisionStump)
         
         Options specific to classifier weka.classifiers.trees.DecisionStump:
         
         -D
          If set, classifier is run in debug mode and
          may output additional info to the console
        Specified by:
        setOptions in interface OptionHandler
        Overrides:
        setOptions in class IteratedSingleClassifierEnhancer
        Parameters:
        options - the list of options as an array of strings
        Throws:
        Exception - if an option is not supported
      • shrinkageTipText

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

        public void setShrinkage​(double l)
        Set the shrinkage parameter
        Parameters:
        l - the shrinkage rate.
      • getShrinkage

        public double getShrinkage()
        Get the shrinkage rate.
        Returns:
        the value of the learning rate
      • minimizeAbsoluteErrorTipText

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

        public void setMinimizeAbsoluteError​(boolean f)
        Sets whether absolute error is to be minimized.
        Parameters:
        f - true if absolute error is to be minimized.
      • getMinimizeAbsoluteError

        public boolean getMinimizeAbsoluteError()
        Gets whether absolute error is to be minimized.
        Returns:
        true if absolute error is to be minimized
      • resumeTipText

        public String resumeTipText()
        Tool tip text for the resume property
        Returns:
        the tool tip text for the finalize property
      • setResume

        public void setResume​(boolean resume)
        If called with argument true, then the next time done() is called the model is effectively "frozen" and no further iterations can be performed
        Specified by:
        setResume in interface IterativeClassifier
        Parameters:
        resume - true if the model is to be finalized after performing iterations
      • getResume

        public boolean getResume()
        Returns true if the model is to be finalized (or has been finalized) after training.
        Specified by:
        getResume in interface IterativeClassifier
        Returns:
        the current value of finalize
      • next

        public boolean next()
                     throws Exception
        Perform another iteration.
        Specified by:
        next in interface IterativeClassifier
        Returns:
        false if no further iterations could be performed, true otherwise
        Throws:
        Exception - if this iteration fails for unexpected reasons
      • getMeasure

        public double getMeasure​(String additionalMeasureName)
        Returns the value of the named measure
        Specified by:
        getMeasure in interface AdditionalMeasureProducer
        Parameters:
        additionalMeasureName - the name of the measure to query for its value
        Returns:
        the value of the named measure
        Throws:
        IllegalArgumentException - if the named measure is not supported
      • measureNumIterations

        public double measureNumIterations()
        return the number of iterations (base classifiers) completed
        Returns:
        the number of iterations (same as number of base classifier models)
      • toString

        public String toString()
        Returns textual description of the classifier.
        Overrides:
        toString in class Object
        Returns:
        a description of the classifier as a string
      • main

        public static void main​(String[] argv)
        Main method for testing this class.
        Parameters:
        argv - should contain the following arguments: -t training file [-T test file] [-c class index]