k-means clustering implementation in Javascript?

喜欢而已 提交于 2019-12-21 09:17:28

问题


I'm in need for a Javascript implementation of the k-means clustering algorithm. I only have 1-dimensional data and rarely more than 100 items, so performance is not an issue.

PS: I could only find one but it seems extremely unsteady, resulting in completely different clusters on virtually every call.


回答1:


k-means in Javascript:

http://code.google.com/p/hdict/source/browse/gae/files/kmeans.js

http://www.mymessedupmind.co.uk/index.php/javascript-k-mean-algorithm

Applet:

http://www.math.le.ac.uk/people/ag153/homepage/KmeansKmedoids/kmeans.jar




回答2:


In node and the browser:

https://github.com/harthur/clusterfck

You have a choice between k-means or hierarchical clustering with these distance functions:

  1. euclidean
  2. manhattan
  3. max



回答3:


Simple K-Means implementation: dimas-kmeans

var kmeans = require('dimas-kmeans')

var clusters = kmeans.getClusters(data);


来源:https://stackoverflow.com/questions/7370785/k-means-clustering-implementation-in-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!