{"id":42674525,"url":"https://github.com/rainij/polynomial-regression-js","last_synced_at":"2026-01-29T11:26:31.016Z","repository":{"id":34924052,"uuid":"190537407","full_name":"rainij/polynomial-regression-js","owner":"rainij","description":"Multivariate polynomial regression for javascript/typescript","archived":false,"fork":false,"pushed_at":"2024-09-05T18:24:08.000Z","size":464,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-08T21:25:59.884Z","etag":null,"topics":["javascript","machine-learning","regression-algorithms","typescript"],"latest_commit_sha":null,"homepage":"","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/rainij.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":"2019-06-06T07:41:16.000Z","updated_at":"2025-02-27T17:30:51.000Z","dependencies_parsed_at":"2023-01-15T10:31:49.350Z","dependency_job_id":"e3678cb4-490b-4cdf-8ed3-a151a9d54b1a","html_url":"https://github.com/rainij/polynomial-regression-js","commit_stats":{"total_commits":70,"total_committers":5,"mean_commits":14.0,"dds":0.6,"last_synced_commit":"b880ced6d48b0ae2a073beb7f7c644055514fdad"},"previous_names":["rainij/regression-multivariate-polynomial"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/rainij/polynomial-regression-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainij%2Fpolynomial-regression-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainij%2Fpolynomial-regression-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainij%2Fpolynomial-regression-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainij%2Fpolynomial-regression-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rainij","download_url":"https://codeload.github.com/rainij/polynomial-regression-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rainij%2Fpolynomial-regression-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28876677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T10:31:27.438Z","status":"ssl_error","status_checked_at":"2026-01-29T10:31:01.017Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["javascript","machine-learning","regression-algorithms","typescript"],"created_at":"2026-01-29T11:26:29.919Z","updated_at":"2026-01-29T11:26:30.977Z","avatar_url":"https://github.com/rainij.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  polynomial-regression-js\n\u003c/h1\u003e\n\n[![npm version][npm-image]][npm-url]\n[![npm download][download-image]][npm-url]\n\n**polynomial-regression-js** is a typescript library for linear and polynomial regression\nin multiple variables. It provides a class\n[PolynomialRegressor][doc-polynomial-regressor-url] for multivariate polynomial regression\nand a class [PolynomialFeatures][doc-polynomial-features-url] for transforming input\nfeatures $(x_1,x_2,\\ldots,x_n)$ into polynomial features $(\\ldots,x_1^{k_1}x_2^{k_2}\\ldots\nx_n^{k_n},\\ldots)$.\n\n[API documentation][doc-url] is created using TypeDoc.\n\n# Installation\n\n`npm install --save @rainij/polynomial-regression-js`\n\n# Usage\n\n## PolynomialRegressor\n\n```ts\nimport { PolynomialRegressor } from '@rainij/polynomial-regression-js';\n\n// Y0 = X0^2 + 2*X0*X1, Y1 = X1^2 + 5*X0 + 1\n// Quadratric functions with two inputs need (at least) seven supporting points:\nconst x = [[0, 0], [1, 0], [2, 0], [0, 1], [0, 2], [1, 1], [2, 2]];\nconst y = [[0, 1], [1, 6], [4, 11], [0, 2], [0, 5], [3, 7], [12, 15]];\n\n// Search for a polynomial model of degree = 2.\nconst model = new PolynomialRegressor(2);\nmodel.fit(x,y) // Training\nconsole.log(model.predict([[3, 3]]));\n// [ [27, 25] ]\n```\n\n## PolynomialFeatures\n\n```ts\nimport { PolynomialFeatures } from '@rainij/polynomial-regression-js';\n\nconst x = [[3, 2]] // Two features: [[a, b]]\n\n// Generate polynomial features up to degree 3\nlet polyFeatures = new PolynomialFeatures(3);\n\nconsole.log(polyFeatures.fitTransform(x));\n// [ [27, 18, 9, 12, 6, 3, 8, 4, 2, 1] ]\n// That is: [ [a^3, a^2b, ab^2, ab, a, b^3, b^2, b, 1] ]\n```\n\n[npm-url]: https://www.npmjs.com/package/@rainij/polynomial-regression-js\n\n[npm-url-old]: https://www.npmjs.com/package/regression-multivariate-polynomial\n\n[npm-image]: https://img.shields.io/npm/v/@rainij/polynomial-regression-js.svg\n\n[npm-image-old]: https://img.shields.io/npm/v/regression-multivariate-polynomial.svg\n\n[download-image]: https://img.shields.io/npm/dm/@rainij/polynomial-regression-js.svg\n\n[download-image-old]: https://img.shields.io/npm/dm/regression-multivariate-polynomial.svg\n\n[doc-url]: https://rainij.github.io/polynomial-regression-js/\n\n[doc-polynomial-regressor-url]: https://rainij.github.io/polynomial-regression-js/classes/PolynomialRegressor.html\n\n[doc-polynomial-features-url]: https://rainij.github.io/polynomial-regression-js/classes/PolynomialFeatures.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainij%2Fpolynomial-regression-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frainij%2Fpolynomial-regression-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frainij%2Fpolynomial-regression-js/lists"}