类 SimpleLinearRegression
java.lang.Object
weka.classifiers.Classifier
weka.classifiers.functions.SimpleLinearRegression
- 所有已实现的接口:
Serializable
,Cloneable
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,WeightedInstancesHandler
Learns a simple linear regression model. Picks the attribute that results in the lowest squared error. Missing values are not allowed. Can only deal with numeric attributes.
Valid options are:
-D If set, classifier is run in debug mode and may output additional info to the console
- 版本:
- $Revision: 5523 $
- 作者:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
buildClassifier
(Instances insts) Builds a simple linear regression model given the supplied training data.double
classifyInstance
(Instance inst) Generate a prediction for the supplied instance.boolean
Returns true if a usable attribute was found.int
Returns the index of the attribute used in the regression.Returns default capabilities of the classifier.double
Returns the intercept of the function.Returns the revision string.double
getSlope()
Returns the slope of the function.Returns a string describing this classifierstatic void
Main method for testing this classvoid
setSuppressErrorMessage
(boolean s) Turn off the error message that is reported when no useful attribute is found.toString()
Returns a description of this classifier as a string从类继承的方法 weka.classifiers.Classifier
debugTipText, distributionForInstance, forName, getDebug, getOptions, listOptions, makeCopies, makeCopy, setDebug, setOptions
-
构造器详细资料
-
SimpleLinearRegression
public SimpleLinearRegression()
-
-
方法详细资料
-
globalInfo
Returns a string describing this classifier- 返回:
- a description of the classifier suitable for displaying in the explorer/experimenter gui
-
classifyInstance
Generate a prediction for the supplied instance.- 覆盖:
classifyInstance
在类中Classifier
- 参数:
inst
- the instance to predict.- 返回:
- the prediction
- 抛出:
Exception
- if an error occurs
-
getCapabilities
Returns default capabilities of the classifier.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中Classifier
- 返回:
- the capabilities of this classifier
- 另请参阅:
-
buildClassifier
Builds a simple linear regression model given the supplied training data.- 指定者:
buildClassifier
在类中Classifier
- 参数:
insts
- the training data.- 抛出:
Exception
- if an error occurs
-
foundUsefulAttribute
public boolean foundUsefulAttribute()Returns true if a usable attribute was found.- 返回:
- true if a usable attribute was found.
-
getAttributeIndex
public int getAttributeIndex()Returns the index of the attribute used in the regression.- 返回:
- the index of the attribute.
-
getSlope
public double getSlope()Returns the slope of the function.- 返回:
- the slope.
-
getIntercept
public double getIntercept()Returns the intercept of the function.- 返回:
- the intercept.
-
setSuppressErrorMessage
public void setSuppressErrorMessage(boolean s) Turn off the error message that is reported when no useful attribute is found.- 参数:
s
- if set to true turns off the error message
-
toString
Returns a description of this classifier as a string -
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中Classifier
- 返回:
- the revision
-
main
Main method for testing this class- 参数:
argv
- options
-