Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

ml-hclust

mljs16.5kMIT3.1.0TypeScript support: included

Hierarchical clustering algorithms

cluster, kmeans, hierarchical, data, mining, datamining, machine, learning

readme

hclust

NPM version build status Test coverage npm download

Hierarchical clustering algorithms in JavaScript.

Installation

npm i ml-hclust

API Documentation

Usage

AGNES

const { agnes } = require('ml-hclust');

const tree = agnes(data, {
  method: 'ward',
});

Implemented algorithms

  • <input checked="" disabled="" type="checkbox"> AGNES (AGglomerative NESting): Continuously merge nodes that have the least dissimilarity.
  • <input disabled="" type="checkbox"> DIANA (Divisive ANAlysis): The process starts at the root with all the points as one cluster and recursively splits the higher level clusters to build the dendrogram.
  • <input disabled="" type="checkbox"> BIRCH (Balanced Iterative Reducing and Clustering using Hierarchies): Incrementally construct a CF (Clustering Feature) tree, a hierarchical data structure for multiphase clustering
  • <input disabled="" type="checkbox"> CURE (Clustering Using REpresentatives):
  • <input disabled="" type="checkbox"> CHAMELEON

Test

npm install
npm test

Authors

License

MIT

changelog

Changelog

3.1.0 (2021-09-19)

Features

  • export Cluster class (#13)

3.0.0 (2019-07-16)

Code Refactoring

  • make AGNES algorithm closer to R (#11) (1517124)

BREAKING CHANGES

    • use the Lance-Williams algorithm to update cluster distances.
  • add other methods that exist in R.
  • remove ClusterLeaf class and use an isLeaf property instead.
  • remove index array from clusters. Instead, an indexes() method has been added to compute it.
  • add a size property to clusters that indicates the number of leaves below it.
  • the default method is now 'complete'.
  • DIANA has been removed from the package pending rewriting it.

2.0.3 (2019-07-10)

Bug Fixes

  • correct definitions of options interfaces (b07d3a4)
  • improve performance of ward algorithm (3bad3b6)

2.0.2 (2019-07-10)

Bug Fixes

2.0.1 (2019-07-10)

Bug Fixes

2.0.0 (2019-05-02)

Code Refactoring

  • agnes: rename options.kind to options.method (acabbe6)
  • rework options and write TS definitions (f49c7af)
  • rewrite project as ESM and use rollup (f02ad0a)

BREAKING CHANGES

  • agnes: options.kind was renamed to options.method in agnes.
  • the disFunc option was renamed to distanceFunction.
  • Node.js 4 and 6 are no longer supported.

1.3.0 (2017-02-22)

Features

  • cluster: add traverse method (e437076)

1.2.1 (2017-02-10)

1.2.0 (2016-09-05)

Features

  • cluster: use a heap to group clusters (8c70c9e)

1.1.2 (2016-09-01)

1.1.1 (2016-09-01)

Bug Fixes

  • Cluster: possible infinite loop when all the clusters are leafs (ba234a7)
  • CLuster: group method brok in the case when reached a leaf (b09148f)

1.1.0 (2016-08-16)

Features

  • agnes: add agglomerative clustering algorithm based on a distance matrix (7609eb0)

1.0.1 (2016-08-16)

1.0.0 (2015-07-24)

0.1.0 (2015-07-01)