{"id":19267103,"url":"https://github.com/mljs/pcr","last_synced_at":"2025-02-23T19:29:50.507Z","repository":{"id":43354012,"uuid":"188542428","full_name":"mljs/pcr","owner":"mljs","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-17T11:58:28.000Z","size":1351,"stargazers_count":2,"open_issues_count":4,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-05T12:12:33.567Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://mljs.github.io/pcr/","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}},"created_at":"2019-05-25T08:45:59.000Z","updated_at":"2022-10-17T11:57:03.000Z","dependencies_parsed_at":"2023-01-20T02:20:26.610Z","dependency_job_id":null,"html_url":"https://github.com/mljs/pcr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fpcr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fpcr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fpcr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fpcr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mljs","download_url":"https://codeload.github.com/mljs/pcr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240367682,"owners_count":19790294,"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:10:26.146Z","updated_at":"2025-02-23T19:29:50.441Z","avatar_url":"https://github.com/mljs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PCR\n\nPrincipal component regression.\n\n[![NPM version][npm-image]][npm-url]\n[![build status][ci-image]][ci-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![npm download][download-image]][download-url]\n\n## Installation\n\n`$ npm install ml-pcr`\n\n## Usage\n\n```js\nconst { PCR } = require('pcr');\n\nconst x = [\n  [0, 0],\n  [1, 2],\n  [2, 3],\n  [3, 4],\n];\n\nconst y = [\n  [0, 0, 0],\n  [2, 4, 3],\n  [4, 6, 5],\n  [6, 8, 7],\n];\n\nconst pcr = new PCR(x, y, { intercept: true, weight: 1 });\nconsole.log(pcr.predict([3, 3])); // Predict Y for an given X\n// [6, 6, 6]\n\nconsole.log(pcr.getLoadingsdata()); // Returns the information of loadings used to perform the linear regression\n/*\n{\n    weigth: 99.20021500994476,\n    evalues: 4.546676521289134,\n    componentNumber: 1,\n    component: [ [Array] ]\n  },\n  {\n    weigth: 0.7997849900552465,\n    evalues: 0.036656812044198794,\n    componentNumber: 2,\n    component: [ [Array] ]\n  }\n]\n*/\n```\n\n## References\n\n- Miller, J. N., \u0026 Miller, J. C. (2010). Statistics and Chemometrics for Analytical Chemistry.\n\n- [Wikipedia](https://en.wikipedia.org/wiki/Principal_component_regression).\n\n## License\n\n[MIT](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/ml-pcr.svg\n[npm-url]: https://npmjs.org/package/ml-pcr\n[ci-image]: https://github.com/mljs/pcr/workflows/Node.js%20CI/badge.svg?branch=master\n[ci-url]: https://github.com/mljs/pcr/actions?query=workflow%3A%22Node.js+CI%22\n[codecov-image]: https://img.shields.io/codecov/c/github/mljs/ml-pcr.svg\n[codecov-url]: https://codecov.io/gh/mljs/ml-pcr\n[download-image]: https://img.shields.io/npm/dm/ml-pcr.svg\n[download-url]: https://npmjs.org/package/ml-pcr\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fpcr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmljs%2Fpcr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fpcr/lists"}