How to plot with t-SNE in MATLAB from 5 elements composition into 2 dimensions?

3 ビュー (過去 30 日間)
Majid Vaghari
Majid Vaghari 2022 年 2 月 17 日
回答済み: Akanksha 2025 年 3 月 1 日
I would like to make a figure like the below figure!
T-distributed stochastic neighbor embedding (t-SNE) used in the figure to visualize across the composition space in two dimensions (I have a 5 element composition space for the alloy and entropy of mixing calculate from the composition).
Entropy of mixing=;
We have the data for the entropy of mixing and compositions in the Excel attached file.
My question is now how to visualize from composition space with 5 elements into just two dimensions! The results should be like a pentagon, because the attached picture is for a 6 elements alloy and is like a hexagon.
P.mat attached matrix contains x1,x2,x3,x4,x5,.
How to make a t-SNE from P matrix?
Best
Majid
  1 件のコメント
Majid Vaghari
Majid Vaghari 2022 年 2 月 17 日
The data is big so I cannot attached them here.
If anyone can solve the problem, I can send the data by email.

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

回答 (1 件)

Akanksha
Akanksha 2025 年 3 月 1 日
The resolution to visualize from composition space with 5 elements into 2D can be achieved using the following code :
%1. Load your Nx5 data matrix: P. Also, ensure P is in your MATLAB workspace.
%2. Run t-SNE
Y = tsne(P, 'Perplexity', 30, 'Exaggeration', 5);
%3. Plot the results, coloring by S (an Nx1 vector)
figure;
scatter(Y(:,1), Y(:,2), 50, S, 'filled');
colorbar;
xlabel('t-SNE 1');
ylabel('t-SNE 2');
title('t-SNE Projection of 5-element Compositions');
I have tested this code on small sample data set and successfully generated a meaningful 2D scatter plot, where each point is coloured by its associated property value.
Below I have also attached relevant MATLAB Documentation that will help you :
Hope this helps. Thanks.

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by