javax.visrec.regression

## Class SimpleLinearRegression<MODEL_CLASS>

- java.lang.Object
- - javax.visrec.regression.SimpleLinearRegression<MODEL_CLASS>

All Implemented Interfaces:
  Regressor<Float,Float>

    public abstract class SimpleLinearRegression<MODEL_CLASS>
    extends Object
    implements Regressor<Float,Float>

Simple linear regression finds the best possible straight line that tries to explain given training set.

Author:
  zoran

### Constructor Summary

Constructors
Constructor and Description
`SimpleLinearRegression()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`abstract float` `getIntercept()` The value of output when input is zero
`MODEL_CLASS` `getModel()`
`abstract float` `getSlope()` How much on average output change when input changes by one.
`abstract Float` `predict(Float inputs)`
`protected void` `setModel(MODEL_CLASS model)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SimpleLinearRegression

    public SimpleLinearRegression()

### Method Detail

#### getModel

    public MODEL_CLASS getModel()

#### setModel

    protected void setModel(MODEL_CLASS model)

#### predict

    public abstract Float predict(Float inputs)

Specified by:
  `predict` in interface `Regressor<Float,Float>`

#### getSlope

    public abstract float getSlope()

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:

#### getIntercept

    public abstract float getIntercept()

The value of output when input is zero

Returns: