JSPM

linearregressionjs

1.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q9186F
  • License MIT

Get a calculated linear regression for a matrix with X and Y axis.

Package Exports

  • linearregressionjs

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (linearregressionjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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)