Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
[UNMAINTAINED] K-means and hierarchical clustering
JavaScript CSS
tree: ee00f48173

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
Jakefile.js
LICENSE
README.md
build.js
package.json

README.md

clusterfck

A js hierarchical clustering lib. Demo here and docs here.

install

git clone http://github.com/harthur/clusterfck.git
cd clusterfck
npm install .

usage

var clusterfck = require("clusterfck");

var colors = [[20, 120, 102],
              [0, 230, 93],
              [250, 255, 253],
              [100, 54, 300]]; // array of vectors

var threshold = 9; // only combine two clusters if they have distance less than 9

var clusters = clusterfck.hcluster(colors, clusterfck.EUCLIDEAN_DISTANCE,
    clusterfck.AVERAGE_LINKAGE, threshold);

clusters will be an array of clusters. Each cluster is a hierarchy with left and right clusters. The leaf clusters have a canonical property as well which contains the original item (in this case, the array of rgb values).

Something went wrong with that request. Please try again.