{"_id":"regression","_rev":"374809","name":"regression","description":"Javascript least squares data fitting methods","dist-tags":{"latest":"2.0.1"},"maintainers":[{"name":"tom-alexander","email":"me@tomalexander.co.nz"}],"time":{"modified":"2021-07-30T05:38:54.000Z","created":"2014-07-17T11:24:26.309Z","2.0.1":"2017-12-10T10:55:16.642Z","2.0.0":"2017-07-15T03:07:52.611Z","1.4.0":"2016-12-18T20:53:02.230Z","1.2.1":"2015-05-05T23:58:59.944Z","1.2.0":"2014-07-17T11:24:26.309Z"},"users":{"parkerproject":true,"cmpolis":true,"mastayoda":true,"tobitobitobi":true,"mysticatea":true,"binarymax":true,"3xl":true,"mimmo1":true},"author":{"name":"Tom Alexander","email":"me@tomalexander.co.nz"},"repository":{"type":"git","url":"git+https://github.com/tom-alexander/regression-js.git"},"versions":{"2.0.1":{"name":"regression","description":"Javascript least squares data fitting methods","contributors":[{"name":"Tom Alexander","email":"me@tomalexander.co.nz"},{"name":"Misha Wolfson","email":"misha@ginkgobioworks.com"}],"version":"2.0.1","license":"MIT","main":"./dist/regression.js","repository":{"type":"git","url":"git+https://github.com/tom-alexander/regression-js.git"},"keywords":["regression","data","fiting","modeling","analysis"],"scripts":{"clean":"rm -rf dist && mkdir dist","lint":"eslint src/** tests/**","test":"npm run lint && ./node_modules/.bin/nyc --reporter=lcov ./node_modules/.bin/mocha --compilers js:babel-core/register","build":"npm run clean && npm run build-regression-js && npm run build-regression-min-js","build-regression-js":"BABEL_ENV=production ./node_modules/.bin/babel src/regression.js --out-file dist/regression.js","build-regression-min-js":" ./node_modules/.bin/uglifyjs dist/regression.js --output dist/regression.min.js"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-plugin-transform-es2015-modules-umd":"^6.24.1","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","chai":"^3.5.0","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.2.0","eslint-plugin-import":"^2.7.0","mocha":"^3.2.0","nyc":"^11.0.3","uglify-js":"3"},"author":{"name":"Tom Alexander","email":"me@tomalexander.co.nz"},"gitHead":"7995fd9955ca23a8a99834a9f28aa9c8adc7ad19","bugs":{"url":"https://github.com/tom-alexander/regression-js/issues"},"homepage":"https://github.com/tom-alexander/regression-js#readme","_id":"regression@2.0.1","_shasum":"8d29c3e8224a10850c35e337e85a8b2fac3b0c87","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"tom-alexander","email":"me@tomalexander.co.nz"},"dist":{"shasum":"8d29c3e8224a10850c35e337e85a8b2fac3b0c87","size":40608,"noattachment":false,"key":"/regression/-/regression-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regression/download/regression-2.0.1.tgz"},"maintainers":[{"name":"tom-alexander","email":"me@tomalexander.co.nz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regression-2.0.1.tgz_1512903316533_0.44972028816118836"},"directories":{},"publish_time":1512903316642,"_hasShrinkwrap":false,"_cnpm_publish_time":1512903316642},"2.0.0":{"name":"regression","description":"Javascript least squares data fitting methods","contributors":[{"name":"Tom Alexander","email":"me@tomalexander.co.nz"},{"name":"Misha Wolfson","email":"misha@ginkgobioworks.com"}],"version":"2.0.0","license":"MIT","main":"./dist/regression.js","repository":{"type":"git","url":"git+https://github.com/tom-alexander/regression-js.git"},"keywords":["regression","data","fiting","modeling","analysis"],"scripts":{"clean":"rm -rf dist && mkdir dist","lint":"eslint src/** tests/**","test":"npm run lint && ./node_modules/.bin/nyc --reporter=lcov ./node_modules/.bin/mocha --compilers js:babel-core/register","build":"npm run clean && npm run build-regression-js && npm run build-regression-min-js","build-regression-js":"babel src/regression.js --out-file dist/regression.js","build-regression-min-js":"BABEL_ENV=production ./node_modules/.bin/babel src/regression.js --out-file dist/regression.min.js"},"devDependencies":{"babel-cli":"^6.24.1","babel-core":"^6.25.0","babel-plugin-transform-es2015-modules-umd":"^6.24.1","babel-preset-babili":"^0.1.4","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","chai":"^3.5.0","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.2.0","eslint-plugin-import":"^2.7.0","mocha":"^3.2.0","nyc":"^11.0.3"},"gitHead":"f905366d21ee189d6d9e9173b0f4ff99562117f3","bugs":{"url":"https://github.com/tom-alexander/regression-js/issues"},"homepage":"https://github.com/tom-alexander/regression-js#readme","_id":"regression@2.0.0","_shasum":"0f23e4012f0a4c2b5ef828b4f4b4e39f72dfb96a","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"tom-alexander","email":"me@tomalexander.co.nz"},"dist":{"shasum":"0f23e4012f0a4c2b5ef828b4f4b4e39f72dfb96a","size":30047,"noattachment":false,"key":"/regression/-/regression-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regression/download/regression-2.0.0.tgz"},"maintainers":[{"name":"tom-alexander","email":"me@tomalexander.co.nz"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/regression-2.0.0.tgz_1500088072182_0.8579580299556255"},"directories":{},"publish_time":1500088072611,"_cnpm_publish_time":1500088072611,"_hasShrinkwrap":false},"1.4.0":{"name":"regression","description":"Javascript least squares data fitting methods","contributors":[{"name":"Tom Alexander","email":"me@tomalexander.co.nz"},{"name":"Misha Wolfson","email":"misha@ginkgobioworks.com"}],"version":"1.4.0","license":"MIT","repository":{"type":"git","url":"git+https://github.com/tom-alexander/regression-js.git"},"keywords":["regression","data","fitting","modelling","analysis"],"scripts":{"test":"grunt test","build":"grunt"},"devDependencies":{"babel-eslint":"^7.1.1","eslint":"^3.12.2","eslint-config-airbnb-es5":"^1.1.0","eslint-plugin-react":"^6.8.0","grunt":"~0.4.1","grunt-contrib-uglify":"~0.2.2","grunt-eslint":"^19.0.0","grunt-mocha-test":"^0.13.2","mocha":"^3.2.0"},"gitHead":"0a97486bd5e3d7a648a1a3d59bf71441eedfda36","bugs":{"url":"https://github.com/tom-alexander/regression-js/issues"},"homepage":"https://github.com/tom-alexander/regression-js#readme","_id":"regression@1.4.0","_shasum":"d3468f9fbada1c70161df31f6c64301677ac5a70","_from":".","_npmVersion":"2.14.20","_nodeVersion":"4.4.1","_npmUser":{"name":"tom-alexander","email":"me@tomalexander.co.nz"},"dist":{"shasum":"d3468f9fbada1c70161df31f6c64301677ac5a70","size":7421,"noattachment":false,"key":"/regression/-/regression-1.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regression/download/regression-1.4.0.tgz"},"maintainers":[{"name":"tom-alexander","email":"me@tomalexander.co.nz"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/regression-1.4.0.tgz_1482094380144_0.8209839367773384"},"directories":{},"publish_time":1482094382230,"_cnpm_publish_time":1482094382230,"_hasShrinkwrap":false},"1.2.1":{"name":"regression","description":"Javascript least squares data fitting methods","author":{"name":"Tom Alexander","email":"me@tomalexander.co.nz"},"version":"1.2.1","license":"MIT","repository":{"type":"git","url":"https://github.com/Tom-Alexander/regression-js"},"keywords":["regression","data","fitting","modelling","analysis"],"devDependencies":{"grunt":"~0.4.1","grunt-contrib-uglify":"~0.2.2"},"gitHead":"ae4596905e0be4c092e5625fb21e84840ad1e4f1","bugs":{"url":"https://github.com/Tom-Alexander/regression-js/issues"},"homepage":"https://github.com/Tom-Alexander/regression-js","_id":"regression@1.2.1","scripts":{},"_shasum":"d4e96c0341adb38130903b8ae2f9dced905d606d","_from":".","_npmVersion":"2.7.4","_nodeVersion":"0.12.2","_npmUser":{"name":"tom-alexander","email":"me@tomalexander.co.nz"},"maintainers":[{"name":"tom-alexander","email":"me@tomalexander.co.nz"}],"dist":{"shasum":"d4e96c0341adb38130903b8ae2f9dced905d606d","size":4214,"noattachment":false,"key":"/regression/-/regression-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/regression/download/regression-1.2.1.tgz"},"directories":{},"publish_time":1430870339944,"_cnpm_publish_time":1430870339944,"_hasShrinkwrap":false},"1.2.0":{"name":"regression","description":"Javascript least squares data fitting methods","author":{"name":"Tom Alexander","email":"me@tomalexander.co.nz"},"version":"1.2.0","license":"MIT","repository":{"type":"git","url":"git://github.com/Tom-Alexander/regression-js"},"keywords":["regression","data","fitting","modelling","analysis"],"devDependencies":{"grunt":"~0.4.1","grunt-contrib-uglify":"~0.2.2"},"gitHead":"9961bb266aa8d9ff0a50d63bbc4af879c8ba60b3","bugs":{"url":"https://github.com/Tom-Alexander/regression-js/issues"},"homepage":"https://github.com/Tom-Alexander/regression-js","_id":"regression@1.2.0","scripts":{},"_shasum":"3e6a1b8f6a34990cff9f3369a55327ddb0755f43","_from":"./","_npmVersion":"1.4.14","_npmUser":{"name":"tom-alexander","email":"me@tomalexander.co.nz"},"maintainers":[{"name":"tom-alexander","email":"me@tomalexander.co.nz"}],"dist":{"shasum":"3e6a1b8f6a34990cff9f3369a55327ddb0755f43","size":8017,"noattachment":false,"key":"/regression/-/regression-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/regression/download/regression-1.2.0.tgz"},"directories":{},"publish_time":1405596266309,"_cnpm_publish_time":1405596266309,"_hasShrinkwrap":false}},"readme":"\n<div align=\"center\">\n<h1>regression-js</h1>\n<a href=\"https://travis-ci.org/Tom-Alexander/regression-js\">\n<img src=\"https://travis-ci.org/Tom-Alexander/regression-js.svg?branch=master\"/>\n</a>\n<a href=\"https://npmjs.com/package/regression\">\n<img src=\"https://img.shields.io/npm/v/regression.svg\" alt=\"npm version\" />\n</a>\n<a href=\"https://npmjs.com/package/regression\">\n<img src=\"https://img.shields.io/npm/dt/regression.svg\" alt=\"npm downloads\" />\n</a>\n<a href=\"https://codeclimate.com/github/Tom-Alexander/regression-js/coverage\"><img src=\"https://codeclimate.com/github/Tom-Alexander/regression-js/badges/coverage.svg\" /></a>\n<br/>\n<br/>\n<p>\nregression-js is a JavaScript module containing a collection of linear least-squares fitting methods for simple data analysis.\n</p>\n</div>\n\n## Installation\nThis module works on node and in the browser. It is available as the 'regression' package on [npm](https://www.npmjs.com/package/regression). It is also available on a [CDN](https://cdnjs.com/libraries/regression).\n\n### npm\n\n```\nnpm install --save regression\n```\n\n## Usage\n\n```javascript\nimport regression from 'regression';\nconst result = regression.linear([[0, 1], [32, 67], [12, 79]]);\nconst gradient = result.equation[0];\nconst yIntercept = result.equation[1];\n```\n\nData is passed into the model as an array. A second parameter can be used to configure the model. The configuration parameter is optional. `null` values are ignored. The precision option will set the number of significant figures the output is rounded to.\n\n### Configuration options\nBelow are the default values for the configuration parameter.\n```javascript\n{\n  order: 2,\n  precision: 2,\n}\n```\n\n### Properties\n- `equation`: an array containing the coefficients of the equation\n- `string`: A string representation of the equation\n- `points`: an array containing the predicted data in the domain of the input\n- `r2`: the coefficient of determination (<i>R</i><sup>2</sup>)\n- `predict(x)`: This function will return the predicted value\n\n## API\n\n### `regression.linear(data[, options])`\nFits the input data to a straight line with the equation ![y = mx + c](http://mathurl.com/ycqyhets.png). It returns the coefficients in the form `[m, c]`.\n\n### `regression.exponential(data[, options])`\nFits the input data to a exponential curve with the equation ![y = ae^bx](http://mathurl.com/zuys53z.png). It returns the coefficients in the form `[a, b]`.\n\n### `regression.logarithmic(data[, options])`\nFits the input data to a logarithmic curve with the equation ![y = a + b ln x](http://mathurl.com/zye394m.png). It returns the coefficients in the form `[a, b]`.\n\n### `regression.power(data[, options])`\nFits the input data to a power law curve with the equation ![y = ax^b](http://mathurl.com/gojkazs.png). It returns the coefficients in the form `[a, b]`.\n\n### `regression.polynomial(data[, options])`\nFits the input data to a polynomial curve with the equation ![anx^n ... + a1x + a0](http://mathurl.com/hxz543o.png). It returns the coefficients in the form `[an..., a1, a0]`. The order can be configure with the `order` option.\n\n#### Example\n\n```javascript\nconst data = [[0,1],[32, 67] .... [12, 79]];\nconst result = regression.polynomial(data, { order: 3 });\n```\n\n## Development\n\n- Install the dependencies with `npm install`\n- To build the assets in the `dist` directory, use `npm run build`\n- You can run the tests with: `npm run test`.\n","_attachments":{},"homepage":"https://github.com/tom-alexander/regression-js#readme","bugs":{"url":"https://github.com/tom-alexander/regression-js/issues"},"license":"MIT"}