{"id":17930510,"url":"https://github.com/lovasoa/expectation-maximization","last_synced_at":"2025-03-24T04:31:19.296Z","repository":{"id":66344169,"uuid":"76748521","full_name":"lovasoa/expectation-maximization","owner":"lovasoa","description":"Multivariate gaussian fit with expectation–maximization (EM) algorithm in javascript.","archived":false,"fork":false,"pushed_at":"2016-12-20T13:52:13.000Z","size":1069,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-30T07:00:19.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://lovasoa.github.io/expectation-maximization/dist/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lovasoa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-12-17T21:50:30.000Z","updated_at":"2021-08-05T12:00:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9314bb6-0eb7-48c3-a66d-c17f937f3cef","html_url":"https://github.com/lovasoa/expectation-maximization","commit_stats":{"total_commits":58,"total_committers":1,"mean_commits":58.0,"dds":0.0,"last_synced_commit":"1b4396c2defcda50f1695a90feed7f4bc33c7b55"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fexpectation-maximization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fexpectation-maximization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fexpectation-maximization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fexpectation-maximization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovasoa","download_url":"https://codeload.github.com/lovasoa/expectation-maximization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245211081,"owners_count":20578341,"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-10-28T21:13:54.425Z","updated_at":"2025-03-24T04:31:19.050Z","avatar_url":"https://github.com/lovasoa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expectation-maximization\n\n[![Build Status](https://travis-ci.org/lovasoa/expectation-maximization.svg?branch=master)](https://travis-ci.org/lovasoa/expectation-maximization)\n\nExpectation–maximization (EM) algorithm for n-dimensional vectors, implemented in javascript.\nThis allows to fit points with a multivariate gaussian mixture model.\n\nThis can be used for statistical classification of multivariate data, anomaly\ndetection, or predictive analytics.\n\n## Goal\n\nYou have n-dimensional datapoints that belong to k groups.\nWith this algorithm, you can detect not only which point belongs to which group, but also what the features of each group (mean, covariance) are.\n\nThe algorithm works by repetitively estimating the probability of each point to belong to each group, and maximizing the parameters of the groups so that they best fit the data. [Detailed description of the algorithm on wikipedia](https://en.wikipedia.org/wiki/Expectation%E2%80%93maximization_algorithm)\n\n![Visualization of the consecutive steps of the algorithm. Image from Wikipedia](https://upload.wikimedia.org/wikipedia/commons/6/69/EM_Clustering_of_Old_Faithful_data.gif)\n\n## How to use\n\n ```js\nvar expectation_maximization = require('expectation-maximization');\n\n// n-dimensional data points are stored as a simple array of array\nvar points = [\n  [1,2], [3,4], [5,6]\n];\n\nvar n_groups = 2; // We clusterize our data into two groups\nvar groups = expectation_maximization(points, n_groups);\n\n////// result:\n[\n  {\n    weight: .5, // weight (a-priori probabibility) of the group\n    mu: [2, 3], // mean vector of the group\n    sigma: [[1,0],[0,1]] // covariance matrix of the group\n  },\n  ... // other groups\n]\n ```\n\n## Documentation\n\nAuto-generated *jsdoc* documentation\n[is available here](https://github.com/lovasoa/expectation-maximization/tree/master/docs)\n\n## Demo\n\nA basic demo is availaible here:\nhttps://lovasoa.github.io/expectation-maximization/dist/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasoa%2Fexpectation-maximization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovasoa%2Fexpectation-maximization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasoa%2Fexpectation-maximization/lists"}