类 LinearRegression
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.functions.LinearRegression
- 所有已实现的接口:
Serializable
,Cloneable
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,WeightedInstancesHandler
Class for using linear regression for prediction. Uses the Akaike criterion for model selection, and is able to deal with weighted instances.
Valid options are:
-D Produce debugging output. (default no debugging output)
-S <number of selection method> Set the attribute selection method to use. 1 = None, 2 = Greedy. (default 0 = M5' method)
-C Do not try to eliminate colinear attributes.
-R <double> Set ridge parameter (default 1.0e-8).
- 版本:
- $Revision: 9770 $
- 作者:
- Eibe Frank (eibe@cs.waikato.ac.nz), Len Trigg (trigg@cs.waikato.ac.nz)
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明static final int
Attribute selection method: Greedy methodstatic final int
Attribute selection method: M5 methodstatic final int
Attribute selection method: No attribute selectionstatic final Tag[]
Attribute selection methods -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明Returns the tip text for this propertyvoid
buildClassifier
(Instances data) Builds a regression model for the given data.double
classifyInstance
(Instance instance) Classifies the given instance using the linear regression function.double[]
Returns the coefficients for this linear model.Returns the tip text for this propertyReturns the tip text for this propertyGets the method used to select attributes for use in the linear regression.Returns default capabilities of the classifier.boolean
getDebug()
Controls whether debugging output will be printedboolean
Get the value of EliminateColinearAttributes.String[]
Gets the current settings of the classifier.Returns the revision string.double
getRidge()
Get the value of Ridge.Returns a string describing this classifierReturns an enumeration describing the available options.static void
Generates a linear regression function predictor.int
Get the number of coefficients used in the modelReturns the tip text for this propertyvoid
Sets the method used to select attributes for use in the linear regression.void
setDebug
(boolean debug) Controls whether debugging output will be printedvoid
setEliminateColinearAttributes
(boolean newEliminateColinearAttributes) Set the value of EliminateColinearAttributes.void
setOptions
(String[] options) Parses a given list of options.void
setRidge
(double newRidge) Set the value of Ridge.toString()
Outputs the linear regression model as a string.void
Turns off checks for missing values, etc.void
Turns on checks for missing values, etc.从类继承的方法 weka.classifiers.Classifier
distributionForInstance, forName, makeCopies, makeCopy
-
字段详细资料
-
SELECTION_M5
public static final int SELECTION_M5Attribute selection method: M5 method- 另请参阅:
-
SELECTION_NONE
public static final int SELECTION_NONEAttribute selection method: No attribute selection- 另请参阅:
-
SELECTION_GREEDY
public static final int SELECTION_GREEDYAttribute selection method: Greedy method- 另请参阅:
-
TAGS_SELECTION
Attribute selection methods
-
-
构造器详细资料
-
LinearRegression
public LinearRegression()
-
-
方法详细资料
-
turnChecksOff
public void turnChecksOff()Turns off checks for missing values, etc. Use with caution. Also turns off scaling. -
turnChecksOn
public void turnChecksOn()Turns on checks for missing values, etc. Also turns on scaling. -
globalInfo
Returns a string describing this classifier- 返回:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
-
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中Classifier
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildClassifier
Builds a regression model for the given data.- 指定者:
buildClassifier
在类中Classifier
- 参数:
data
- the training data to be used for generating the linear regression function- 抛出:
Exception
- if the classifier could not be built successfully
-
classifyInstance
Classifies the given instance using the linear regression function.- 覆盖:
classifyInstance
在类中Classifier
- 参数:
instance
- the test instance- 返回:
- the classification
- 抛出:
Exception
- if classification can't be done successfully
-
toString
Outputs the linear regression model as a string. -
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 覆盖:
listOptions
在类中Classifier
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. Valid options are:-D Produce debugging output. (default no debugging output)
-S <number of selection method> Set the attribute selection method to use. 1 = None, 2 = Greedy. (default 0 = M5' method)
-C Do not try to eliminate colinear attributes.
-R <double> Set ridge parameter (default 1.0e-8).
- 指定者:
setOptions
在接口中OptionHandler
- 覆盖:
setOptions
在类中Classifier
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
coefficients
public double[] coefficients()Returns the coefficients for this linear model.- 返回:
- the coefficients for this linear model
-
getOptions
Gets the current settings of the classifier.- 指定者:
getOptions
在接口中OptionHandler
- 覆盖:
getOptions
在类中Classifier
- 返回:
- an array of strings suitable for passing to setOptions
-
ridgeTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getRidge
public double getRidge()Get the value of Ridge.- 返回:
- Value of Ridge.
-
setRidge
public void setRidge(double newRidge) Set the value of Ridge.- 参数:
newRidge
- Value to assign to Ridge.
-
eliminateColinearAttributesTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getEliminateColinearAttributes
public boolean getEliminateColinearAttributes()Get the value of EliminateColinearAttributes.- 返回:
- Value of EliminateColinearAttributes.
-
setEliminateColinearAttributes
public void setEliminateColinearAttributes(boolean newEliminateColinearAttributes) Set the value of EliminateColinearAttributes.- 参数:
newEliminateColinearAttributes
- Value to assign to EliminateColinearAttributes.
-
numParameters
public int numParameters()Get the number of coefficients used in the model- 返回:
- the number of coefficients
-
attributeSelectionMethodTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setAttributeSelectionMethod
Sets the method used to select attributes for use in the linear regression.- 参数:
method
- the attribute selection method to use.
-
getAttributeSelectionMethod
Gets the method used to select attributes for use in the linear regression.- 返回:
- the method to use.
-
debugTipText
Returns the tip text for this property- 覆盖:
debugTipText
在类中Classifier
- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setDebug
public void setDebug(boolean debug) Controls whether debugging output will be printed- 覆盖:
setDebug
在类中Classifier
- 参数:
debug
- true if debugging output should be printed
-
getDebug
public boolean getDebug()Controls whether debugging output will be printed- 覆盖:
getDebug
在类中Classifier
- 返回:
- true if debugging output is printed
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Classifier
- 返回:
- the revision
-
main
Generates a linear regression function predictor.- 参数:
argv
- the options
-