Function Reference Manual: Difference between revisions
imported>WikiAdmin (New page: == cluster == '''Purpose''' Agglomerative and K-means cluster analysis with dendrograms. '''Synopsis''' :[results,fig] = cluster(data'',labels,options'') :[results,fig] = cluster(d...) |
imported>WikiAdmin No edit summary |
||
Line 1: | Line 1: | ||
== cluster == | == cluster == | ||
Line 8: | Line 7: | ||
'''Synopsis''' | '''Synopsis''' | ||
:[results,fig] = cluster(data'',labels,options'') | :[results,fig] = cluster(data'',labels,options'') |
Revision as of 14:07, 11 August 2008
cluster
Purpose
Agglomerative and K-means cluster analysis with dendrograms.
Synopsis
- [results,fig] = cluster(data,labels,options)
- [results,fig] = cluster(data,options)
- options = cluster('options')
Description
cluster(data) performs a cluster analysis using either one of six different agglomerative methods (including K-Nearest-Neighbor (KNN), furthest neighbor, and Ward's method) or K-means clustering algorithm and plots a dendrogram. The input is data (class double or dataset).
Optional input labels can be used to put labels on the dendrogram plots. For data M by N then labels must be a character array with M rows. When labels is not specified and data is class “double”, the dendrogram is plotted using sample numbers. When labels is not specified and data is class “dataset”, the dendrogram is plotted using sample labels. If the labels field is empty it will use sample numbers.
The output is a dendrogram showing the sample distances.
Note: Calling cluster}} with no inputs starts the graphical user interface (GUI) for this analysis method.
OUTPUTS:
The outputs are (results) a structure containing results of the clustering (defined below) and the handle (fig) to any plot created. The results structure will contain the following fields:
results = cluster(data); %do cluster
ind = max(find(results.dist<threshold)); %user-desired threshold
thisclass = results.class(ind,:); %grab arbitrary classes
Options
- Furthest Neighbor
See Also agcluster, [analysis.html analysis], [corrmap.html corrmap], dendrogram, [gcluster.html gcluster], [simca.html simca]