Feature to image representation using Matplotlib

Опубликовано: 19 Март 2026
на канале: MEDIOCRE_GUY
11
0

t-Distributed Stochastic Neighbor Embedding (t-SNE) is a non-linear dimensionality reduction technique which allows us to visualize high-dimensional data in a lower-dimensional space.

I used sklearn's 𝐝𝐢𝐠𝐢𝐭𝐬 dataset for this example which contains images of 0 to 9 having a resolution of 𝟖𝐱𝟖 pixels. I selected 5 samples of each digit. I applied t-SNE to their features and reduced their dimensionality from 64 to 2. Then, I visualized the reduced features in a 2D plot. I also replaced these features with their corresponding images in another 2D plot.

𝗚𝗶𝘁𝗛𝘂𝗯 𝗮𝗱𝗱𝗿𝗲𝘀𝘀: https://github.com/randomaccess2023/M...

𝙄𝙢𝙥𝙤𝙧𝙩𝙖𝙣𝙩 𝙩𝙞𝙢𝙚𝙨𝙩𝙖𝙢𝙥𝙨:
00:37 - Import required libraries
02:16 - Load sklearn's 𝗱𝗶𝗴𝗶𝘁𝘀 dataset
04:14 - Concatenate 𝗫 and 𝘆 in a single dataframe
05:01 - Select a shorter dataframe
07:33 - Separate features and classes from the shorter dataframe
09:16 - Apply 𝘁-𝗦𝗡𝗘
10:36 - Feature to image representation

#tsne #featuretoimagerepresentation #datascience #jupyternotebook #matplotlib #pyhton