Prototypes-Hierarchical categorisation of data

12 visualizzazioni (ultimi 30 giorni)
sia ben
sia ben il 29 Mag 2023
Risposto: Shubham il 5 Nov 2024 alle 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?

Risposte (1)

Shubham
Shubham il 5 Nov 2024 alle 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

Categorie

Scopri di più su MATLAB in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by