Class ClassificationViaRegression

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, CapabilitiesHandler, OptionHandler, RevisionHandler, TechnicalInformationHandler

    public class ClassificationViaRegression
    extends SingleClassifierEnhancer
    implements 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)
    Version:
    $Revision: 1.27 $
    Author:
    Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (trigg@cs.waikato.ac.nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • ClassificationViaRegression

        public ClassificationViaRegression()
        Default constructor.
    • Method Detail

      • globalInfo

        public java.lang.String globalInfo()
        Returns a string describing classifier
        Returns:
        a description 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
      • buildClassifier

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

        public double[] distributionForInstance​(Instance inst)
                                         throws java.lang.Exception
        Returns the distribution for an instance.
        Overrides:
        distributionForInstance in class Classifier
        Parameters:
        inst - the instance to get the distribution for
        Returns:
        the computed distribution
        Throws:
        java.lang.Exception - if the distribution can't be computed successfully
      • toString

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

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