Function File: T = clusterdata (X, cutoff)
Function File: T = clusterdata (X, Name, Value)

Wrapper function for linkage and cluster.

If cutoff is used, then clusterdata calls linkage and cluster with default value, using cutoff as a threshold value for cluster. If cutoff is an integer and greater or equal to 2, then cutoff is interpreted as the maximum number of cluster desired and the ’MaxClust’ option is used for cluster.

If cutoff is not used, then clusterdata expects a list of pair arguments. Then you must specify either the ’Cutoff’ or ’MaxClust’ option for cluster. The method and metric used by linkage, are defined through the ’linkage’ and ’distance’ arguments.

See also: cluster,dendrogram,inconsistent,kmeans,linkage,pdist.

Demonstration 1

The following code

 X = [(randn (10, 2) * 0.25) + 1; (randn (20, 2) * 0.5) - 1];
 wnl = warning ("off", "Octave:linkage_savemem", "local");
 T = clusterdata (X, "linkage", "ward", "MaxClust", 2);
 scatter (X(:,1), X(:,2), 36, T, "filled");

Produces the following figure

Figure 1

Package: statistics