public class SimpleLinearRegression
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
SimpleLinearRegression()
Default constructor.
|
SimpleLinearRegression(int attIndex,
double slope,
double intercept)
Construct a simple linear regression model based on the given info.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addModel(SimpleLinearRegression slr)
Takes the given simple linear regression model and adds it to this one.
|
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.
|
double |
getIntercept()
Returns the intercept of the function.
|
double |
getSlope()
Returns the slope of the function.
|
public SimpleLinearRegression()
public SimpleLinearRegression(int attIndex,
double slope,
double intercept)
public void addModel(SimpleLinearRegression slr) throws java.lang.Exception
java.lang.Exceptionpublic double classifyInstance(Instance inst)
inst - the instance to predict.public void buildClassifier(Instances insts)
insts - the training data.public boolean foundUsefulAttribute()
public int getAttributeIndex()
public double getSlope()
public double getIntercept()