https://github.com/mljs/expectation-maximization
https://github.com/mljs/expectation-maximization
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/mljs/expectation-maximization
- Owner: mljs
- License: mit
- Created: 2017-03-13T18:45:40.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-11-04T15:36:26.000Z (over 7 years ago)
- Last Synced: 2025-02-12T20:39:13.780Z (4 months ago)
- Language: JavaScript
- Size: 1.2 MB
- Stars: 2
- Watchers: 8
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: History.md
- License: LICENSE
Awesome Lists containing this project
README
# expectation-maximization
[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![David deps][david-image]][david-url]
[![npm download][download-image]][download-url]Gaussian Mixture Models using Expectation Maximization algorithm transcribed from Expectation Maximization [repository](https://github.com/lovasoa/expectation-maximization)
of Ophir LOJKINE, also using his multivariate gaussian [link](https://github.com/lovasoa/multivariate-gaussian).## Installation
`$ npm install ml-expectation-maximization`
## Example
```js
const ExpectationMaximization = require('ml-expectation-maximization').ExpectationMaximization;
const em = new ExpectationMaximization();
em.train(data); // data is a training matrix
em.predict(toPredict); // data matrix to predict/*
Get information about clusters obtained on the training step.
Each element of the array is a cluster with the following information* weight: Weight of the current cluster.
* mean: Current mean of the cluster.
* covariance: Covariance matrix of the cluster.
* prediction: prediction label associated with the cluster.
*/
var data = em.getClusterData();// save your model
var model = em.toJSON();// load your model
var newEM = EM.load(model);
```## [API Documentation](https://mljs.github.io/expectation-maximization/)
## License
[MIT](./LICENSE)
[npm-image]: https://img.shields.io/npm/v/ml-expectation-maximization.svg?style=flat-square
[npm-url]: https://npmjs.org/package/ml-expectation-maximization
[travis-image]: https://img.shields.io/travis/mljs/expectation-maximization/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/mljs/expectation-maximization
[david-image]: https://img.shields.io/david/mljs/expectation-maximization.svg?style=flat-square
[david-url]: https://david-dm.org/mljs/expectation-maximization
[download-image]: https://img.shields.io/npm/dm/ml-expectation-maximization.svg?style=flat-square
[download-url]: https://npmjs.org/package/ml-expectation-maximization