Class LogClassRegressor

  • 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

    public class LogClassRegressor
    extends weka.classifiers.SingleClassifierEnhancer
    Takes log of the class attribute in the data.

    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.rules.ZeroR)
     Options specific to classifier weka.classifiers.rules.ZeroR:
     
     -D
      If set, classifier is run in debug mode and
      may output additional info to the console
    Author:
    Eibe Frank
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static double CLASS_CONSTANT
      Constant to add to class before logarithm is taken.
      • 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 data)
      Builds the classifier.
      double classifyInstance​(weka.core.Instance inst)
      Returns the prediction.
      String getRevision()  
      String globalInfo()
      Returns a string describing classifier.
      static void main​(String[] args)
      Main method for running this class.
      String toString()
      Returns description of classifier.
      weka.core.Instance transform​(weka.core.Instance inst)
      Transform instance.
      • Methods inherited from class weka.classifiers.SingleClassifierEnhancer

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

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

      • CLASS_CONSTANT

        public static final double CLASS_CONSTANT
        Constant to add to class before logarithm is taken.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LogClassRegressor

        public LogClassRegressor()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing classifier.
        Returns:
        a description suitable for displaying in the explorer/experimenter gui
      • transform

        public weka.core.Instance transform​(weka.core.Instance inst)
        Transform instance.
        Parameters:
        inst - the instance to transform
        Returns:
        the transformed instance
      • buildClassifier

        public void buildClassifier​(weka.core.Instances data)
                             throws Exception
        Builds the classifier.
        Parameters:
        data - the training data
        Throws:
        Exception - if something goes wrong
      • classifyInstance

        public double classifyInstance​(weka.core.Instance inst)
                                throws Exception
        Returns the prediction.
        Specified by:
        classifyInstance in interface weka.classifiers.Classifier
        Overrides:
        classifyInstance in class weka.classifiers.AbstractClassifier
        Parameters:
        inst - the instance to predict
        Returns:
        the prediction
        Throws:
        Exception - if prediction fails
      • toString

        public String toString()
        Returns description of classifier.
        Overrides:
        toString in class Object
        Returns:
        the description
      • getRevision

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

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