Giter Site home page Giter Site logo

hclust.jl's Introduction

HClust

Build Status

Hierarchical Clustering for Julia, similar to R's hclust()

Status

The package is currently work-in-progress. Clustering involves doing a lot of admin, and it is easy to make an error. I've tested the results for medium sized clusters (up to 250---5000) elements, for the following methods:

method validated at matrix size time validated
:single 5000 1.3 OK
:complete 2500 4.5 OK
:average 2500 4.5 OK

Usage

d = rand(1000,1000)
d += d'  ## make sure distance matrix d is symmetric (this is optional)
h = hclust(d, :single)

hclust()

hclust(distance::Matrix, method::Symbol)

Performs hierarchical clustering for distance matrix d (which is forced to be symmetric), using one of three methods:

  • :single: cluster distance is equal to the minimum distance between any of the members
  • :average: cluster distance is equal to the mean distance between any of the cluster's members
  • :complete: cluster distance is equal to the maximum distance between any of the members.

The output of hclust() is an object of type Hclust with the fields

  • merge the clusters merged in order. Leafs are indicated by negative numbers
  • height the distance at which the merges take place
  • order a preferred grouping for drawing a dendogram. Not implemented, always [1:n].
  • labels labels of the clusters. Not implemented, now always [1:n]
  • method the name of the clustering method.

cutree()

cutree(cl:Hclust; h, k)

Cuts the cluster tree at height h or amounting to k clusters.

The output is a vector of indices. The nth element in this vector indicates the cluster that this data point belongs to.

hclust.jl's People

Contributors

davidavdav avatar slundberg avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.