ngx-regression-multivariate-linear
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

ml-regression-multivariate-linear

NPM version npm download

Multivariate linear regression. [edited for Angular 2+ usage]

Installation

npm install --save ngx-regression-multivariate-linear

API ( See ml-regression-multivariate-linear )

new MLR(x, y[, options])

Arguments

  • x: Matrix containing the inputs
  • y: Matrix containing the outputs

Options

  • intercept: boolean indicating if intercept terms should be computed (default: true)
  • statistics: boolean for calculating and returning regression statistics (default: true)

Usage

import MLR from 'ngx-regression-multivariate-linear';
 
const x = [[0, 0], [1, 2], [2, 3], [3, 4]];
// Y0 = X0 * 2, Y1 = X1 * 2, Y2 = X0 + X1
const y = [[0, 0, 0], [2, 4, 3], [4, 6, 5], [6, 8, 7]];
const mlr = new MLR(x, y);
console.log(mlr.predict([3, 3]));
// [6, 6, 6]

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i ngx-regression-multivariate-linear

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

11.5 kB

Total Files

5

Last publish

Collaborators

  • alexlndn