필터 지우기
필터 지우기

Find a variable in clustergram

조회 수: 2 (최근 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 CenterFile Exchange에서 Install Products에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by