12 views (last 30 days)
I have t-sne output of a dataset that involves two clusters and I want to label all data of dataset according to this t-sne output.
rng default % for reproducibility
Y = tsne(Data);
Data is a matrix which has 2779x204 dimension, Y has 2779x2 matrix and gsactter visulizes the output. When I click one point in gscatter, I can get the observation value that matches to Y but I want to get group of observation values.
Is there any way to get multiple observation values from gscatter or another way to find inverse t-sne?
Image Analyst on 13 Sep 2022
gscatter takes a minimum of 3 input arguments. You're passing in only 2. What is your group identification array?
You can use masking to get the values in some rectangle.
x = Y(:, 1);
y = Y(:, 2);
indexesInBox = (x > xmin) & (x <= xmax) & (y >= ymin) & (y <= ymax); % Logical vector.
% Extract points in the box.
xDataInBox = x(indexesInBox);
yDataInBox = y(indexesInBox);
See drawing rectangle demo, attached.