https://github.com/mljs/regression-theil-sen
Method for robust fitting a line to a set of points
https://github.com/mljs/regression-theil-sen
Last synced: 2 months ago
JSON representation
Method for robust fitting a line to a set of points
- Host: GitHub
- URL: https://github.com/mljs/regression-theil-sen
- Owner: mljs
- License: mit
- Created: 2017-06-21T15:25:14.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2024-05-16T14:35:01.000Z (about 1 year ago)
- Last Synced: 2025-04-15T11:46:39.518Z (2 months ago)
- Language: JavaScript
- Homepage: https://mljs.github.io/regression-theil-sen/
- Size: 1.18 MB
- Stars: 2
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# regression-theil-sen
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![npm download][download-image]][download-url]Method for robust fitting a line to a set of points.
## Installation
`$ npm i ml-regression-theil-sen`
## Usage
```js
import { TheilSenRegression } from 'ml-regression-theil-sen';var inputs = [1, 2, 3, 4, 5, 6, 7, 8, 9];
var outputs = [2, 3, 4, 20, 6, 7, 8, 9, 10];var regression = new TheilSenRegression(inputs, outputs);
var y = regression.predict(85);y === 85;
regression.toString(3) === 'f(x) = x + 1.00';
```## [API Documentation](https://mljs.github.io/regression-theil-sen/)
The method is well explained on [this article](https://en.wikipedia.org/wiki/Theil%E2%80%93Sen_estimator).
## License
[MIT](./LICENSE)
[npm-image]: https://img.shields.io/npm/v/ml-regression-theil-sen.svg?style=flat-square
[npm-url]: https://npmjs.org/package/ml-regression-theil-sen
[travis-image]: https://img.shields.io/travis/mljs/regression-theil-sen/main.svg?style=flat-square
[travis-url]: https://travis-ci.org/mljs/regression-theil-sen
[download-image]: https://img.shields.io/npm/dm/ml-regression-theil-sen.svg?style=flat-square
[download-url]: https://npmjs.org/package/ml-regression-theil-sen