{"id":19266988,"url":"https://github.com/mljs/expectation-maximization","last_synced_at":"2026-05-16T04:48:16.155Z","repository":{"id":57298968,"uuid":"84862399","full_name":"mljs/expectation-maximization","owner":"mljs","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-04T15:36:26.000Z","size":1262,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-02-12T20:39:13.780Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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":"History.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":"2017-03-13T18:45:40.000Z","updated_at":"2018-01-11T16:24:12.000Z","dependencies_parsed_at":"2022-08-26T18:12:41.674Z","dependency_job_id":null,"html_url":"https://github.com/mljs/expectation-maximization","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%2Fexpectation-maximization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fexpectation-maximization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fexpectation-maximization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mljs%2Fexpectation-maximization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mljs","download_url":"https://codeload.github.com/mljs/expectation-maximization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240324065,"owners_count":19783455,"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:08:56.545Z","updated_at":"2026-05-16T04:48:16.115Z","avatar_url":"https://github.com/mljs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expectation-maximization\n\n  [![NPM version][npm-image]][npm-url]\n  [![build status][travis-image]][travis-url]\n  [![David deps][david-image]][david-url]\n  [![npm download][download-image]][download-url]\n\nGaussian Mixture Models using Expectation Maximization algorithm transcribed from Expectation Maximization [repository](https://github.com/lovasoa/expectation-maximization)\nof Ophir LOJKINE, also using his multivariate gaussian [link](https://github.com/lovasoa/multivariate-gaussian).\n\n## Installation\n\n`$ npm install ml-expectation-maximization`\n\n## Example\n\n```js\nconst ExpectationMaximization = require('ml-expectation-maximization').ExpectationMaximization;\nconst em = new ExpectationMaximization();\nem.train(data); // data is a training matrix\nem.predict(toPredict); // data matrix to predict\n\n/*\nGet information about clusters obtained on the training step.\nEach element of the array is a cluster with the following information\n\n* weight: Weight of the current cluster.\n* mean: Current mean of the cluster.\n* covariance: Covariance matrix of the cluster.\n* prediction: prediction label associated with the cluster.\n*/\nvar data = em.getClusterData();\n\n// save your model\nvar model = em.toJSON();\n\n// load your model\nvar newEM = EM.load(model);\n```\n\n## [API Documentation](https://mljs.github.io/expectation-maximization/)\n\n## License\n\n[MIT](./LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/ml-expectation-maximization.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/ml-expectation-maximization\n[travis-image]: https://img.shields.io/travis/mljs/expectation-maximization/master.svg?style=flat-square\n[travis-url]: https://travis-ci.org/mljs/expectation-maximization\n[david-image]: https://img.shields.io/david/mljs/expectation-maximization.svg?style=flat-square\n[david-url]: https://david-dm.org/mljs/expectation-maximization\n[download-image]: https://img.shields.io/npm/dm/ml-expectation-maximization.svg?style=flat-square\n[download-url]: https://npmjs.org/package/ml-expectation-maximization\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fexpectation-maximization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmljs%2Fexpectation-maximization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmljs%2Fexpectation-maximization/lists"}