|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.AbstractClassifier
weka.classifiers.functions.SimpleLinearRegression
public class SimpleLinearRegression
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
Constructor Summary | |
---|---|
SimpleLinearRegression()
|
Method Summary | |
---|---|
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 |
foundUsefulAttribute()
Returns true if a usable attribute was found. |
int |
getAttributeIndex()
Returns the index of the attribute used in the regression. |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
double |
getIntercept()
Returns the intercept of the function. |
String |
getRevision()
Returns the revision string. |
double |
getSlope()
Returns the slope of the function. |
String |
globalInfo()
Returns a string describing this classifier |
static void |
main(String[] argv)
Main method for testing this class |
void |
setSuppressErrorMessage(boolean s)
Turn off the error message that is reported when no useful attribute is found. |
String |
toString()
Returns a description of this classifier as a string |
Methods inherited from class weka.classifiers.AbstractClassifier |
---|
debugTipText, distributionForInstance, forName, getDebug, getOptions, listOptions, makeCopies, makeCopy, runClassifier, setDebug, setOptions |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SimpleLinearRegression()
Method Detail |
---|
public String globalInfo()
public double classifyInstance(Instance inst) throws Exception
classifyInstance
in interface Classifier
classifyInstance
in class AbstractClassifier
inst
- the instance to predict.
Exception
- if an error occurspublic Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
Capabilities
public void buildClassifier(Instances insts) throws Exception
buildClassifier
in interface Classifier
insts
- the training data.
Exception
- if an error occurspublic boolean foundUsefulAttribute()
public int getAttributeIndex()
public double getSlope()
public double getIntercept()
public void setSuppressErrorMessage(boolean s)
s
- if set to true turns off the error messagepublic String toString()
toString
in class Object
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public static void main(String[] argv)
argv
- options
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |