JSPM

ml-regression-multivariate-linear

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 38713
  • Score
    100M100P100Q174153F
  • License MIT

Multivariate linear regression

Package Exports

  • ml-regression-multivariate-linear

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 (ml-regression-multivariate-linear) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

regression-multivariate-linear

NPM version build status npm download

Multivariate linear regression.

Installation

$ npm install --save ml-regression-multivariate-linear

API

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)

Usage

import MLR from 'ml-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