{"id":19267072,"url":"https://github.com/mljs/pca","last_synced_at":"2025-05-16T11:06:15.289Z","repository":{"id":22355522,"uuid":"25691526","full_name":"mljs/pca","owner":"mljs","description":"Principal component analysis","archived":false,"fork":false,"pushed_at":"2024-10-14T13:59:53.000Z","size":1339,"stargazers_count":99,"open_issues_count":8,"forks_count":22,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-04-12T07:00:18.137Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"https://mljs.github.io/pca/","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":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-10-24T14:10:04.000Z","updated_at":"2025-01-02T00:22:07.000Z","dependencies_parsed_at":"2023-11-23T10:24:39.241Z","dependency_job_id":"512871f4-71ee-4a1a-b566-afdfe8c80fb1","html_url":"https://github.com/mljs/pca","commit_stats":{"total_commits":99,"total_committers":11,"mean_commits":9.0,"dds":0.4242424242424242,"last_synced_commit":"090ac51da611acd9f64e2f5a8a9b9e59032d9a3d"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fpca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fpca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fpca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fpca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mljs","download_url":"https://codeload.github.com/mljs/pca/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254518383,"owners_count":22084374,"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":["hacktoberfest"],"created_at":"2024-11-09T20:09:59.185Z","updated_at":"2025-05-16T11:06:10.279Z","avatar_url":"https://github.com/mljs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ml-pca\n\nPrincipal component analysis (PCA).\n\n\u003ch3 align=\"center\"\u003e\n\n  \u003ca href=\"https://www.zakodium.com\"\u003e\n    \u003cimg src=\"https://www.zakodium.com/brand/zakodium-logo-white.svg\" width=\"50\" alt=\"Zakodium logo\" /\u003e\n  \u003c/a\u003e\n\n  \u003cp\u003e\n    Maintained by \u003ca href=\"https://www.zakodium.com\"\u003eZakodium\u003c/a\u003e\n  \u003c/p\u003e\n\n[![NPM version][npm-image]][npm-url]\n[![build status][ci-image]][ci-url]\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7314532.svg)](https://doi.org/10.5281/zenodo.7314532)\n[![npm download][download-image]][download-url]\n\n\u003c/h3\u003e\n\n## Installation\n\n`$ npm install ml-pca`\n\n## Usage\n\n```js\nconst { PCA } = require('ml-pca');\nconst dataset = require('ml-dataset-iris').getNumbers();\n// dataset is a two-dimensional array where rows represent the samples and columns the features\nconst pca = new PCA(dataset);\nconsole.log(pca.getExplainedVariance());\n/*\n[ 0.9246187232017269,\n  0.05306648311706785,\n  0.017102609807929704,\n  0.005212183873275558 ]\n*/\nconst newPoints = [\n  [4.9, 3.2, 1.2, 0.4],\n  [5.4, 3.3, 1.4, 0.9],\n];\nconsole.log(pca.predict(newPoints)); // project new points into the PCA space\n/*\n[\n  [ -2.830722471866897,\n    0.01139060953209596,\n    0.0030369648815961603,\n    -0.2817812120420965 ],\n  [ -2.308002707614927,\n    -0.3175048770719249,\n    0.059976053412802766,\n    -0.688413413360567 ]]\n*/\n```\n\n## [API Documentation](https://mljs.github.io/pca/)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/ml-pca.svg\n[npm-url]: https://npmjs.org/package/ml-pca\n[ci-image]: https://github.com/mljs/pca/actions/workflows/nodejs.yml/badge.svg\n[ci-url]: https://github.com/mljs/pca/actions/workflows/nodejs.yml\n[download-image]: https://img.shields.io/npm/dm/ml-pca.svg\n[download-url]: https://npmjs.org/package/ml-pca\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fpca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmljs%2Fpca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fpca/lists"}