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.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 Summary
Fields Modifier and Type Field Description protected boolean
m_Minimal
Conserve memory?protected LinearRegressionJ
m_Model
the underlying model.protected boolean
m_outputAdditionalStats
Whether to output additional statistics such as std.protected double[]
m_Ranking
the degtermined attribute ranking.protected double
m_Ridge
The ridge parameter
-
Constructor Summary
Constructors Constructor Description LinearRegressionAttributeEval()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildEvaluator(weka.core.Instances instances)
Generates a attribute evaluator.double
evaluateAttribute(int i)
evaluates an individual attributeweka.core.Capabilities
getCapabilities()
Returns the capabilities of this evaluator.boolean
getMinimal()
Returns whether to be more memory conservative or being able to output the model as string.String[]
getOptions()
boolean
getOutputAdditionalStats()
Get whether to output additional statistics (such as std.double
getRidge()
Get the value of Ridge.String
globalInfo()
Returns a string describing this attribute evaluatorEnumeration<weka.core.Option>
listOptions()
static void
main(String[] args)
Main method for running this class from commandline.String
ridgeTipText()
Returns the tip text for this propertyvoid
setMinimal(boolean value)
Sets whether to be more memory conservative or being able to output the model as string.void
setOptions(String[] options)
void
setOutputAdditionalStats(boolean additional)
Set whether to output additional statistics (such as std.void
setRidge(double newRidge)
Set the value of Ridge.String
toString()
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:
listOptions
in interfaceweka.core.OptionHandler
- Overrides:
listOptions
in classweka.attributeSelection.ASEvaluation
-
setOptions
public void setOptions(String[] options) throws Exception
- Specified by:
setOptions
in interfaceweka.core.OptionHandler
- Overrides:
setOptions
in 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:
getOptions
in interfaceweka.core.OptionHandler
- Overrides:
getOptions
in 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:
getCapabilities
in interfaceweka.core.CapabilitiesHandler
- Overrides:
getCapabilities
in classweka.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 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 Exception
evaluates an individual attribute- Specified by:
evaluateAttribute
in 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
-
-