Prototypes-Hierarchical categorisation of data

12 vues (au cours des 30 derniers jours)
sia ben
sia ben le 29 Mai 2023
Réponse apportée : Shubham le 5 Nov 2024 à 3:32
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?

Réponses (1)

Shubham
Shubham le 5 Nov 2024 à 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

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by