The CLUSTER function computes the classification of an m -column, n -row array, where m is the number of variables and n is the number of observations or samples. The classification is based upon a cluster analysis of sample-based distances. The result is a 1-column, n -row array of cluster number assignments that correspond to each sample.
Define an array with 4 variables and 10 observations.
Compute the cluster weights, using two distinct clusters.
weights = CLUST_WTS(array, N_CLUSTERS=2)
Compute the classification of each sample.
result = CLUSTER(array, weights, N_CLUSTERS=2)
Print each sample (each row) of the array and its corresponding cluster assignment.
FOR k = 0, N_ELEMENTS(result)-1 DO PRINT, $