k-means clustering implementation in Javascript?

2020-07-06 05:56发布

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.

3条回答
对你真心纯属浪费
2楼-- · 2020-07-06 06:33

Simple K-Means implementation: dimas-kmeans

var kmeans = require('dimas-kmeans')

var clusters = kmeans.getClusters(data);
查看更多
太酷不给撩
3楼-- · 2020-07-06 06:40

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
查看更多
登录 后发表回答