Prototypes-Hierarchical categorisation of data

12 visualizaciones (últimos 30 días)
sia ben
sia ben el 29 de Mayo de 2023
Respondida: Shubham el 5 de Nov. de 2024 a las 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?

Respuestas (1)

Shubham
Shubham el 5 de Nov. de 2024 a las 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

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by