https://github.com/mljs/regression-multivariate-linear
Multivariate linear regression
https://github.com/mljs/regression-multivariate-linear
Last synced: 2 months ago
JSON representation
Multivariate linear regression
- Host: GitHub
- URL: https://github.com/mljs/regression-multivariate-linear
- Owner: mljs
- License: mit
- Created: 2017-06-28T13:32:46.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-21T12:45:28.000Z (about 3 years ago)
- Last Synced: 2025-04-16T18:17:54.696Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.32 MB
- Stars: 33
- Watchers: 13
- Forks: 13
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ml-regression-multivariate-linear
[![NPM version][npm-image]][npm-url]
[![build status][ci-image]][ci-url]
[![npm download][download-image]][download-url]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)
- `statistics`: boolean for calculating and returning regression statistics (default: true)## Usage
```js
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](./LICENSE)
[npm-image]: https://img.shields.io/npm/v/ml-regression-multivariate-linear.svg
[npm-url]: https://npmjs.org/package/ml-regression-multivariate-linear
[ci-image]: https://github.com/mljs/regression-multivariate-linear/workflows/Node.js%20CI/badge.svg?branch=master
[ci-url]: https://github.com/mljs/regression-multivariate-linear/actions?query=workflow%3A%22Node.js+CI%22
[download-image]: https://img.shields.io/npm/dm/ml-regression-multivariate-linear.svg
[download-url]: https://npmjs.org/package/ml-regression-multivariate-linear