PRTools Contents

PRTools User Guide

hclust

HCLUST

hierarchical clustering, faster version

   [LABELS, DENDROGRAM] = HCLUST(D,TYPE,K)
    DENDROGRAM = HCLUST(D,TYPE)

Input
 D dissimilarity matrix
 TYPE string name of clustering criterion (optional)  's' or 'single' : single linkage (default)  'c' or 'complete' : complete linkage  'a' or 'average' : average linkage  (weighted over cluster sizes)  'r' or 'central' : central linkage
 K number of clusters (optional)

Output
 LABELS vector with labels
 DENDROGRAM matrix with dendrogram

Description

Computation of cluster labels and a clustering dendrogram for the  objects with a given dissimilarity matrix D. K is the desired number of

clusters. The dendrogram is a 2*K matrix. The first row yields all
cluster sizes. The second row is the cluster level on which the set of
clusters starting at that position is merged with the set of clusters
just above it in the dendrogram. A dendrogram may be plotted by PLOTDG.

    DENDROGRAM = HCLUST(D,TYPE)

As in this case no clustering level is supplied, just the entire  dendrogram is returned. The first row now contains the object indices.

Example(s)

 a = gendats([25 25],20,5);     % 50 points in 20-dimensional feature space
 d = sqrt(distm(a));            % Euclidean distances
 dendg = hclustf(d,'complete'); % dendrogram
 plotdg(dendg)
 lab = hclust(d,'complete',2); % labels
 confmat(lab,getlabels(a));     % confusion matrix

See also

plotdg, kmeans, kcentres, modeseek, emclust,

PRTools Contents

PRTools User Guide

This file has been automatically generated. If badly readable, use the help-command in Matlab.