Prototypes-Hierarchical categorisation of data

12 Ansichten (letzte 30 Tage)
sia ben
sia ben am 29 Mai 2023
Beantwortet: Shubham am 5 Nov. 2024 um 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?

Antworten (1)

Shubham
Shubham am 5 Nov. 2024 um 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

Kategorien

Mehr zu MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by