clusteringjs
v0.1.2
Published
clusteringjs ============
Downloads
17
Readme
clusteringjs
K-Means
A Node.js K-Means implementation.
How to use
- Install the module
npm install clusteringjs
- Create a K-Means object
var clustering = require('clusteringjs');
var kmeans = new clustering.KMeans(k, e); // k = numer of clusters, e = max error
- Cluster something
kmeans.cluster(input); // input = array of points
- Use the cluster
var clusters = kmeans.getClusters(); var cluster = kmeans.classify(point); // point = [x, y]
http://en.wikipedia.org/wiki/K-means_clustering
