Library to calculate linear regression in arduino ( Better use Regressino a new library with linear regression and more )
LinearRegression lr = LinearRegression();
LinearRegression lr = LinearRegression(0,100);
LinearRegression();
Initializes object
LinearRegression(int min, int max);
Initializes the object with limits to the value of X
- min: min value of X
- max: max value of X
void learn(int x, int y);
Learns one example.
- x: value of X
- y: value of Y
double calculate(int x);
Estimates value of Y for X
- x: value of x
double correlation();
Return actual correlation value
void reset();
Reset values. Start learning since zero.
void getValues(double values[]);
Returns parameters of the linear regression
- values[0] = m;
- values[1] = b;
- values[2] = n;
Y = m*X + b
n is the number of examples