{"id":19266998,"url":"https://github.com/mljs/regression-polynomial-2d","last_synced_at":"2026-02-16T14:36:26.746Z","repository":{"id":237897212,"uuid":"795448561","full_name":"mljs/regression-polynomial-2d","owner":"mljs","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-16T13:52:13.000Z","size":68,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-10-03T23:33:58.226Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mljs.github.io/regression-polynomial-2d/","language":"TypeScript","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":"2024-05-03T09:57:22.000Z","updated_at":"2024-06-11T09:32:31.000Z","dependencies_parsed_at":"2024-05-16T15:05:41.757Z","dependency_job_id":null,"html_url":"https://github.com/mljs/regression-polynomial-2d","commit_stats":null,"previous_names":["mljs/regression-polynomial-2d"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/mljs/regression-polynomial-2d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fregression-polynomial-2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fregression-polynomial-2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fregression-polynomial-2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fregression-polynomial-2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mljs","download_url":"https://codeload.github.com/mljs/regression-polynomial-2d/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fregression-polynomial-2d/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29510307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T09:05:14.864Z","status":"ssl_error","status_checked_at":"2026-02-16T08:55:59.364Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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:05.370Z","updated_at":"2026-02-16T14:36:26.730Z","avatar_url":"https://github.com/mljs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# regression-polynomial-2d\n\n[![NPM version][npm-image]][npm-url]\n[![npm download][download-image]][download-url]\n[![build status][ci-image]][ci-url]\n[![Test coverage][codecov-image]][codecov-url]\n\nPolynomial Regression.\n\n## Installation\n\n`$ npm i ml-regression-polynomial-2d`\n\n## Usage\n\n```js\nimport { PolynomialRegression2D } from 'ml-regression-polynomial-2d';\n\nconst inputs = {\n  x: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],\n  y: [\n    10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,\n    29, 30,\n  ],\n};\nconst z = [\n  20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,\n  39, 40,\n];\nconst order = 2; // setup the maximum degree of the polynomial\n\nconst regression = new PolynomialRegression2D(inputs, z, { order });\n\n//prediction\nconsole.log(regression.predict({ x: 0.5, y: 1.5 })); // Apply the model to some x tuple.\nconsole.log(regression.predict({ x: [0.5, 1.5], y: [1.5, 2.5] })); // Apply the model to an array of points tuple.\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());\nconsole.log(regression.score); // { r, r2, chi2, rmsd } statistical scores\nconsole.log(regression.getScore(x, y)); // calculate the score for another database\n```\n\n## License\n\n[MIT](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/ml-regression-polynomial-2d.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/ml-regression-polynomial-2d\n[download-image]: https://img.shields.io/npm/dm/ml-regression-polynomial-2d.svg?style=flat-square\n[download-url]: https://npmjs.org/package/ml-regression-polynomial-2d\n[codecov-image]: https://img.shields.io/codecov/c/github/mljs/regression-polynomial-2d.svg\n[codecov-url]: https://codecov.io/gh/mljs/regression-polynomial-2d\n[ci-image]: https://github.com/mljs/regression-polynomial-2d/workflows/Node.js%20CI/badge.svg?branch=main\n[ci-url]: https://github.com/mljs/regression-polynomial-2d/actions?query=workflow%3A%22Node.js+CI%22\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fregression-polynomial-2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmljs%2Fregression-polynomial-2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fregression-polynomial-2d/lists"}