linearregressionjs

1.0.4 • Public • Published

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)

/linearregressionjs/

    Package Sidebar

    Install

    npm i linearregressionjs

    Weekly Downloads

    4

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    47.2 kB

    Total Files

    14

    Last publish

    Collaborators

    • pptongo