集群data
Agglomerative clusters from data
Syntax
T = clusterdata(X,cutoff)
T = clusterdata(X,Name,Value)
Description
T = clusterdata(
returns the cluster indices (X
,cutoff
)T
) for each observation (row) of the data (X
) while adhering to a threshold for cutting the hierarchical tree (cutoff
).
集群s with additional options specified by one or moreT
= clusterdata(X
,Name,Value
)Name,Value
pair arguments.
Input Arguments
|
Matrix with two or more rows. The rows represent observations, the columns represent categories or dimensions. |
|
When |
Name-Value Pair Arguments
Specify optional comma-separated pairs ofName,Value
arguments.Name
is the argument name andValue
is the corresponding value.Name
must appear inside single quotes (' '
). You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN
.
|
Either |
||||||||||||||||||||||||||||
|
Cutoff for inconsistent or distance measure, a positive scalar. When |
||||||||||||||||||||||||||||
|
Depth for computing inconsistent values, a positive integer. |
||||||||||||||||||||||||||||
|
Any of the distance metric names allowed by
|
||||||||||||||||||||||||||||
|
Any of the linkage methods allowed by the
For details, see the definitions in the |
|
Maximum number of clusters to form, a positive integer. |
|
Either
When Default: |
Output Arguments
|
|
Examples
Tips
The
centroid
andmedian
methods can produce a cluster tree that is not monotonic. This occurs when the distance from the union of two clusters,rands, to a third cluster is less than the distance betweenrands. In this case, in a dendrogram drawn with the default orientation, the path from a leaf to the root node takes some downward steps. To avoid this, use another method. The following image shows a nonmonotonic cluster tree.In this case, cluster 1 and cluster 3 are joined into a new cluster, while the distance between this new cluster and cluster 2 is less than the distance between cluster 1 and cluster 3. This leads to a nonmonotonic tree.
You can provide the output
T
to other functions includingdendrogram
to display the tree,集群
to assign points to clusters,inconsistent
to compute inconsistent measures, andcophenet
to compute the cophenetic correlation coefficient.