{"id":19267027,"url":"https://github.com/mljs/regression","last_synced_at":"2025-04-04T20:16:11.446Z","repository":{"id":27492159,"uuid":"30972317","full_name":"mljs/regression","owner":"mljs","description":"Regression algorithms","archived":false,"fork":false,"pushed_at":"2024-10-17T08:09:11.000Z","size":1396,"stargazers_count":44,"open_issues_count":12,"forks_count":6,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-28T19:08:10.148Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mljs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-18T15:49:18.000Z","updated_at":"2025-03-17T13:30:36.000Z","dependencies_parsed_at":"2024-06-18T15:34:48.927Z","dependency_job_id":"9d642cf2-e01e-40a8-bae1-8c2cebcc8ec4","html_url":"https://github.com/mljs/regression","commit_stats":{"total_commits":86,"total_committers":8,"mean_commits":10.75,"dds":0.7093023255813953,"last_synced_commit":"baaa1493c27a8e32de68258e37d8b3cb8c374788"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fregression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fregression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fregression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fregression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mljs","download_url":"https://codeload.github.com/mljs/regression/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247242683,"owners_count":20907134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T20:09:31.400Z","updated_at":"2025-04-04T20:16:11.419Z","avatar_url":"https://github.com/mljs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ml-regression\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![npm download][download-image]][download-url]\n\nRegression algorithms.\n\n## Installation\n\n`$ npm install ml-regression`\n\n## Examples\n\n### Simple linear regression\n\n```js\nconst SLR = require(\"ml-regression\").SLR;\nlet inputs = [80, 60, 10, 20, 30];\nlet outputs = [20, 40, 30, 50, 60];\n\nlet regression = new SLR(inputs, outputs);\nregression.toString(3) === \"f(x) = - 0.265 * x + 50.6\";\n```\n\n#### External links\n\nCheck this cool blog post for a detailed example:\nhttps://hackernoon.com/machine-learning-with-javascript-part-1-9b97f3ed4fe5\n\n### Polynomial regression\n\n```js\nconst PolynomialRegression = require(\"ml-regression\").PolynomialRegression;\nconst x = [50, 50, 50, 70, 70, 70, 80, 80, 80, 90, 90, 90, 100, 100, 100];\nconst y = [\n  3.3, 2.8, 2.9, 2.3, 2.6, 2.1, 2.5, 2.9, 2.4, 3.0, 3.1, 2.8, 3.3, 3.5, 3.0,\n];\nconst degree = 5; // setup the maximum degree of the polynomial\nconst regression = new PolynomialRegression(x, y, degree);\nconsole.log(regression.predict(80)); // Apply the model to some x value. Prints 2.6.\nconsole.log(regression.coefficients); // Prints the coefficients in increasing order of power (from 0 to degree).\nconsole.log(regression.toString(3)); // Prints a human-readable version of the function.\nconsole.log(regression.toLaTeX());\n```\n\n## License\n\n[MIT](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/ml-regression.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/ml-regression\n[travis-image]: https://img.shields.io/travis/mljs/regression/main.svg?style=flat-square\n[travis-url]: https://travis-ci.org/mljs/regression\n[download-image]: https://img.shields.io/npm/dm/ml-regression.svg?style=flat-square\n[download-url]: https://npmjs.org/package/ml-regression\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fregression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmljs%2Fregression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fregression/lists"}