Prototypes-Hierarchical categorisation of data

12 次查看(过去 30 天)
I have a data (about 2000 rows: absorvations and 12 columns: characteristics). I want to create a prototype of hierarchical categories. My problem with the linkage is
1. It creates imaginary nodes, but I want the nodes as part of the data. i.e. all nodes should be part of the data.
2. It is limited to 30 knots. I want unlimited nodes.
How am I supposed to do that?

回答(1 个)

Shubham
Shubham 2024-11-5,3:32
Hi Sia,
As per my understanding, you are implementing hierarchical clustering in MATLAB and have following concerns:
  • How to use original data points as nodes.
  • How to display all nodes in a dendrogram.
Addressing your first concern, hierarchical clustering can be performed directly on your data points using the linkage function. This treats each data point as an initial cluster and merges them hierarchically. Here's a sample MATLAB script to achieve this:
% Sample data
data = rand(2000, 12);
% Compute distance matrix
distMatrix = pdist(data);
% Perform hierarchical clustering
Z = linkage(distMatrix, 'average');
For your second query, by default, the dendrogram function displays up to 30 leaf nodes. To display the entire tree, you can use:
dendrogram(Z, 0);
Here, "Z" is the matrix generated by the linkage function. Setting the second argument to "0" allows the dendrogram to display all nodes.
For more information, refer to following documentation links:
Hope this helps

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by