Top Description Fields Constructors Methods
javax.visrec.ml.regression

public abstract Class SimpleLinearRegression<MODEL_CLASS>

extends Object
implements Regressor<Float, Float>, ModelProvider<MODEL_CLASS>
Class Inheritance
All Implemented Interfaces
javax.visrec.ml.model.ModelProvider, javax.visrec.ml.regression.Regressor
Type Parameters
<MODEL_CLASS>
Implementation class of the background model
Imports
java.util.Objects, javax.visrec.ml.model.ModelProvider

Simple linear regression finds the best possible straight line that tries to roughly describe given training set. Mathematical formula for linear regression is: prediction = slope * x + intercept which is a formula for linear function (straight line) and that's where the names comes from.

Field Summary

Modifier and TypeField and Description
private MODEL_CLASS

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract float
getIntercept()

Intercept tells us the value of prediction when input is zero.

public MODEL_CLASS
public abstract float

Returns:

slope of the line produced by linear regression.
getSlope
()

Slope parameter of the model tells how much on average output change when input changes by one.

public abstract Float
protected final void
setModel(MODEL_CLASS model)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

modelback to summary
private MODEL_CLASS model

Constructor Detail

SimpleLinearRegressionback to summary
public SimpleLinearRegression()

Method Detail

getInterceptback to summary
public abstract float getIntercept()

Intercept tells us the value of prediction when input is zero.

getModelback to summary
public MODEL_CLASS getModel()

Implements javax.visrec.ml.model.ModelProvider.getModel.

Annotations
@Override
getSlopeback to summary
public abstract float getSlope()

Slope parameter of the model tells how much on average output change when input changes by one. If it is zero there is no linear dependency between input and output, and data is probably scattered. If it is less then one output grows slower then input. If it is greater than one, then output is growing faster than input. If its negative, then output is lowering as input grows.

Returns:float

slope of the line produced by linear regression.

predictback to summary
public abstract Float predict(Float input)

Redeclares javax.visrec.ml.regression.Regressor.predict.

Annotations
@Override
setModelback to summary
protected final void setModel(MODEL_CLASS model)