Class ClassificationViaRegressionD

  • All Implemented Interfaces:
    Serializable, Cloneable, weka.classifiers.Classifier, weka.core.BatchPredictor, weka.core.CapabilitiesHandler, weka.core.CapabilitiesIgnorer, weka.core.CommandlineRunnable, weka.core.OptionHandler, weka.core.RevisionHandler, weka.core.TechnicalInformationHandler

    public class ClassificationViaRegressionD
    extends weka.classifiers.SingleClassifierEnhancer
    implements weka.core.TechnicalInformationHandler
    Class for doing classification using regression methods. Class is binarized and one regression model is built for each class value. For more information, see, for example

    E. Frank, Y. Wang, S. Inglis, G. Holmes, I.H. Witten (1998). Using model trees for classification. Machine Learning. 32(1):63-76.

    BibTeX:
     @article{Frank1998,
        author = {E. Frank and Y. Wang and S. Inglis and G. Holmes and I.H. Witten},
        journal = {Machine Learning},
        number = {1},
        pages = {63-76},
        title = {Using model trees for classification},
        volume = {32},
        year = {1998}
     }
     


    Valid options are:

     -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.M5P)
     Options specific to classifier weka.classifiers.trees.M5P:
     
     -N
      Use unpruned tree/rules
     -U
      Use unsmoothed predictions
     -R
      Build regression tree/rule rather than a model tree/rule
     -M <minimum number of instances>
      Set minimum number of instances per leaf
      (default 4)
     -L
      Save instances at the nodes in
      the tree (for visualization purposes)
    Author:
    Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (trigg@cs.waikato.ac.nz), Dale Fletcher (dale at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected weka.filters.unsupervised.attribute.MakeIndicator[] m_ClassFilters
      The filters used to transform the class.
      protected weka.classifiers.Classifier[] m_Classifiers
      The classifiers.
      • 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
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void buildClassifier​(weka.core.Instances insts)
      Builds the classifiers.
      protected String defaultClassifierString()
      String describing default classifier.
      double[] distributionForInstance​(weka.core.Instance inst)
      Returns the distribution for an instance.
      weka.core.Capabilities getCapabilities()
      Returns default capabilities of the classifier.
      weka.classifiers.Classifier getClassifier​(int index)
      Returns the classifier for the specified label index (0-based).
      String getRevision()
      Returns the revision string.
      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.
      String globalInfo()
      Returns a string describing classifier
      static void main​(String[] args)
      Main method for running this class.
      String toString()
      Prints the classifiers.
      • Methods inherited from class weka.classifiers.SingleClassifierEnhancer

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

        batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
    • Field Detail

      • m_Classifiers

        protected weka.classifiers.Classifier[] m_Classifiers
        The classifiers. (One for each class.)
      • m_ClassFilters

        protected weka.filters.unsupervised.attribute.MakeIndicator[] m_ClassFilters
        The filters used to transform the class.
    • Constructor Detail

      • ClassificationViaRegressionD

        public ClassificationViaRegressionD()
        Default constructor.
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing classifier
        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
        Returns:
        the technical information about this class
      • defaultClassifierString

        protected String defaultClassifierString()
        String describing default classifier.
        Overrides:
        defaultClassifierString in class weka.classifiers.SingleClassifierEnhancer
        Returns:
        the default classifier classname
      • getCapabilities

        public weka.core.Capabilities getCapabilities()
        Returns default capabilities of the classifier.
        Specified by:
        getCapabilities in interface weka.core.CapabilitiesHandler
        Specified by:
        getCapabilities in interface weka.classifiers.Classifier
        Overrides:
        getCapabilities in class weka.classifiers.SingleClassifierEnhancer
        Returns:
        the capabilities of this classifier
      • buildClassifier

        public void buildClassifier​(weka.core.Instances insts)
                             throws Exception
        Builds the classifiers.
        Specified by:
        buildClassifier in interface weka.classifiers.Classifier
        Parameters:
        insts - the training data.
        Throws:
        Exception - if a classifier can't be built
      • distributionForInstance

        public double[] distributionForInstance​(weka.core.Instance inst)
                                         throws Exception
        Returns the distribution for an instance.
        Specified by:
        distributionForInstance in interface weka.classifiers.Classifier
        Overrides:
        distributionForInstance in class weka.classifiers.AbstractClassifier
        Parameters:
        inst - the instance to get the distribution for
        Returns:
        the computed distribution
        Throws:
        Exception - if the distribution can't be computed successfully
      • getClassifier

        public weka.classifiers.Classifier getClassifier​(int index)
        Returns the classifier for the specified label index (0-based).
        Parameters:
        index - the index of the classifier to retrieve
        Returns:
        the classifier
      • toString

        public String toString()
        Prints the classifiers.
        Overrides:
        toString in class Object
        Returns:
        a string representation of the classifier
      • getRevision

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

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