Class LinearRegressionAttributeEval

  • All Implemented Interfaces:
    Serializable, weka.attributeSelection.AttributeEvaluator, weka.core.CapabilitiesHandler, weka.core.CapabilitiesIgnorer, weka.core.CommandlineRunnable, weka.core.OptionHandler, weka.core.RevisionHandler

    public class LinearRegressionAttributeEval
    extends weka.attributeSelection.ASEvaluation
    implements weka.attributeSelection.AttributeEvaluator, weka.core.OptionHandler
    Uses the coefficients of LinearRegressionJ to determine the importance of the attributes (attribute selection turned off, no elimination of collinear attributes).
    Author:
    Hisham Abdel Qader (habdelqa at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Ranking

        protected double[] m_Ranking
        the degtermined attribute ranking.
      • m_Ridge

        protected double m_Ridge
        The ridge parameter
      • m_Minimal

        protected boolean m_Minimal
        Conserve memory?
      • m_outputAdditionalStats

        protected boolean m_outputAdditionalStats
        Whether to output additional statistics such as std. dev. of coefficients and t-stats
    • Constructor Detail

      • LinearRegressionAttributeEval

        public LinearRegressionAttributeEval()
    • 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
      • listOptions

        public Enumeration<weka.core.Option> listOptions()
        Specified by:
        listOptions in interface weka.core.OptionHandler
      • setOptions

        public void setOptions​(String[] options)
                        throws Exception
        Specified by:
        setOptions in interface weka.core.OptionHandler
        Throws:
        Exception
      • setOutputAdditionalStats

        public void setOutputAdditionalStats​(boolean additional)
        Set whether to output additional statistics (such as std. deviation of coefficients and t-statistics
        Parameters:
        additional - true if additional stats are to be output
      • setMinimal

        public void setMinimal​(boolean value)
        Sets whether to be more memory conservative or being able to output the model as string.
        Parameters:
        value - if true memory will be conserved
      • ridgeTipText

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

        public double getRidge()
        Get the value of Ridge.
        Returns:
        Value of Ridge.
      • setRidge

        public void setRidge​(double newRidge)
        Set the value of Ridge.
        Parameters:
        newRidge - Value to assign to Ridge.
      • getOptions

        public String[] getOptions()
        Specified by:
        getOptions in interface weka.core.OptionHandler
      • getMinimal

        public boolean getMinimal()
        Returns whether to be more memory conservative or being able to output the model as string.
        Returns:
        true if memory conservation is preferred over outputting model description
      • getOutputAdditionalStats

        public boolean getOutputAdditionalStats()
        Get whether to output additional statistics (such as std. deviation of coefficients and t-statistics
        Returns:
        true if additional stats are to be output
      • getCapabilities

        public weka.core.Capabilities getCapabilities()
        Returns the capabilities of this evaluator.
        Specified by:
        getCapabilities in interface weka.core.CapabilitiesHandler
        Overrides:
        getCapabilities in class weka.attributeSelection.ASEvaluation
        Returns:
        the capabilities of this evaluator
        See Also:
        Capabilities
      • buildEvaluator

        public void buildEvaluator​(weka.core.Instances instances)
                            throws Exception
        Generates a attribute evaluator. Has to initialize all fields of the evaluator that are not being set via options.
        Specified by:
        buildEvaluator in class weka.attributeSelection.ASEvaluation
        Parameters:
        instances - set of instances serving as training data
        Throws:
        Exception - if the evaluator has not been generated successfully
      • evaluateAttribute

        public double evaluateAttribute​(int i)
                                 throws Exception
        evaluates an individual attribute
        Specified by:
        evaluateAttribute in interface weka.attributeSelection.AttributeEvaluator
        Parameters:
        i - the index of the attribute to be evaluated
        Returns:
        the "merit" of the attribute
        Throws:
        Exception - if the attribute could not be evaluated
      • toString

        public String toString()
        Outputs the underlying linear regression model.
        Overrides:
        toString in class Object
        Returns:
        the model output
      • main

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