Find a variable in clustergram

3 ビュー (過去 30 日間)
Luca D'Angelo
Luca D'Angelo 2024 年 3 月 25 日
コメント済み: Luca D'Angelo 2024 年 4 月 12 日
Hi all,
I have a huge database (8334x140) and I want to perform a hierarchical cluster analysis with the Clustergram function.
Cluster = clustergram(DB_hca,'RowLabels',FeatureNames,'ColumnLabels',string((DateTime)),...
'Standardize',2 ,'Colormap',jet,'RowPDist','euclidean','ColumnPDist','euclidean' ,...
'Linkage','ward','DisplayRange',1, 'Symmetric',1, 'Cluster',3);
Few questions:
1) how to save the clustergram as .fig and/or to save as a .jpg or another format (for example: I wanted to attached here but the only way is a screenshot and save it);
2) how to understand where is and visualize my Feature "Vattelapesca" (random name for a random feature that it is one of the 8334 rows)? I can look for it in Cluster.RowLabels but once I know that it is the 835 node, this is not helping me (especially if I have to look for 100 features and not only 1).
Any idea?
Cheers,
Luca

採用された回答

Maneet Kaur Bagga
Maneet Kaur Bagga 2024 年 3 月 28 日
Hi Luca,
As per my understanding, you want to save the clustergram in different file formats and also looking for ways to visualize features within the clustergram output working with the large size of the dataset. Please refer to the following as a possible workaround for both the questions:
1) Saving clustergram as ".fig" and Exporting as ".jpg" or Other Formats:
To save the clustergram as a ".fig" fille, you can use "savefig" function in MATLAB which allows you to open it later in MATLAB for viewing or updating purpose. Once you have the ".fig" file you can save the figure in any other format using the "saveas" function.
savefig(Cluster, 'MyClustergram.fig');
2) Visualizing a Specific Feature
Extract the ordered row labels after clustering, it will give the position of the features after clustering. Then find the position of the features of interest in the ordered list. Once you get the positions, you can visually inspect the clustergram.
orderedLabels = Cluster.RowLabels;
featureIndex = find(strcmp(orderedLabels, 'Vattelapesca'));
Please refer to the following MathWorks documentation for further understanding:
Hope this helps!
  1 件のコメント
Luca D'Angelo
Luca D'Angelo 2024 年 4 月 12 日
Hi Maneet,
thank you for your kind reply. I've also found this way to look for a specific variable but it is really hard to find in a huge clustergram: I hoped that there is a way to visualize directly where the variable is located within the clustergram.
Thank you anyway! :)
Cheers,
Luca

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Management についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by