Skip to content

Pptongo/linear-regression-js

Repository files navigation

linear-regression-js

Library used to calculate a linear regression using an existing matrix with X and Y axis.

NPM version build status npm download

Linear Regression

Installation

$ npm install --save linear-regression-js

Usage

import LinearRegression from 'linear-regression-js';

const matrix = [[1, 2, 3, 4, 5], [3, 4, 2, 4, 5]];
const regression = new LinearRegression(matrix);

const serie = regression.calculate(); // [[1, 2, 3, 4, 5], [2.8, 3.2, 3.6, 4.0, 4.4]]
const r2 = regression.getR2(); // 0.3076923076923078

License

[MIT](./LICENSE)

About

Library used to calculate a linear regression for a matrix with X and Y axis.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published