k-meansjs
v0.0.2
Published
K-Means clustering.
Downloads
3
Maintainers
Readme
k-means
K-Means clustering in JavaScript.
Demo
https://lab.miguelmota.com/k-means
Install
npm install k-meansjs
bower install kmeans
Usage
Take a look at the full example.
var KMeans = require('k-meansjs');
var data = [
[6,5],
[9,10],
[10,1],
[5,5]
...
];
var kmeans = KMeans({
data: data,
k: 3
});
kmeans.on('iteration', function(self) {
draw.call(self);
});
kmeans.on('end', function(self) {
console.log(self.iterations);
});
kmeans.run();
Test
npm test
License
MIT