Package weka.attributeSelection
Class LinearRegressionAttributeEval
- java.lang.Object
-
- weka.attributeSelection.ASEvaluation
-
- weka.attributeSelection.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.OptionHandlerUses 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 Summary
Fields Modifier and Type Field Description protected booleanm_MinimalConserve memory?protected LinearRegressionJm_Modelthe underlying model.protected booleanm_outputAdditionalStatsWhether to output additional statistics such as std. dev. of coefficients and t-statsprotected double[]m_Rankingthe degtermined attribute ranking.protected doublem_RidgeThe ridge parameter
-
Constructor Summary
Constructors Constructor Description LinearRegressionAttributeEval()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildEvaluator(weka.core.Instances instances)Generates a attribute evaluator.doubleevaluateAttribute(int i)evaluates an individual attributeweka.core.CapabilitiesgetCapabilities()Returns the capabilities of this evaluator.booleangetMinimal()Returns whether to be more memory conservative or being able to output the model as string.String[]getOptions()booleangetOutputAdditionalStats()Get whether to output additional statistics (such as std. deviation of coefficients and t-statisticsdoublegetRidge()Get the value of Ridge.StringglobalInfo()Returns a string describing this attribute evaluatorEnumeration<weka.core.Option>listOptions()static voidmain(String[] args)Main method for running this class from commandline.StringridgeTipText()Returns the tip text for this propertyvoidsetMinimal(boolean value)Sets whether to be more memory conservative or being able to output the model as string.voidsetOptions(String[] options)voidsetOutputAdditionalStats(boolean additional)Set whether to output additional statistics (such as std. deviation of coefficients and t-statisticsvoidsetRidge(double newRidge)Set the value of Ridge.StringtoString()Outputs the underlying linear regression model.
-
-
-
Field Detail
-
m_Ranking
protected double[] m_Ranking
the degtermined attribute ranking.
-
m_Model
protected LinearRegressionJ m_Model
the underlying model.
-
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
-
-
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:
listOptionsin interfaceweka.core.OptionHandler- Overrides:
listOptionsin classweka.attributeSelection.ASEvaluation
-
setOptions
public void setOptions(String[] options) throws Exception
- Specified by:
setOptionsin interfaceweka.core.OptionHandler- Overrides:
setOptionsin classweka.attributeSelection.ASEvaluation- 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:
getOptionsin interfaceweka.core.OptionHandler- Overrides:
getOptionsin classweka.attributeSelection.ASEvaluation
-
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:
getCapabilitiesin interfaceweka.core.CapabilitiesHandler- Overrides:
getCapabilitiesin classweka.attributeSelection.ASEvaluation- Returns:
- the capabilities of this evaluator
- See Also:
Capabilities
-
buildEvaluator
public void buildEvaluator(weka.core.Instances instances) throws ExceptionGenerates a attribute evaluator. Has to initialize all fields of the evaluator that are not being set via options.- Specified by:
buildEvaluatorin classweka.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 Exceptionevaluates an individual attribute- Specified by:
evaluateAttributein interfaceweka.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.
-
main
public static void main(String[] args)
Main method for running this class from commandline.- Parameters:
args- the options
-
-