Which is alright, but starts from a premise that is not always true: we know to
which class each data point belongs. However, in many real-life problems, the
dimensionality reduction step is done precisely because we don't know how data
is being clustered together (if at all) and we want to check what is really
going on.

We don't know (though we can take an educated guess) how many classes are in
this dataset or which features are useful to separate them. So, though we can
see some very clear clusters, the only thing we know about them is their t-SNE x
and y coordinates. We can now go to our original dataset and obtain a subset of
data (say, those for which the transformation yielded x < -150, for instance,
and then check what is going on in the featureN original space.

But the other day I found a graphical way of doing this. It uses
plotly (locally) and ggplot. Let's
first build the ggplot object for this:

Nothing special here, just the normal, static ggplot usual graph (won't even
include it here). What would be cool, though, is having system that allows to
explore data in a visual way: when the mouse pointer is placed over a given
point, the featureN values are shown on screen. We can do that with plotly and
a couple of extra lines:

So, what are we doing here? We are creating a hover_text variable for each row
of our dataset (with the help of the apply function) that simply prints the
name of each column in the dataset followed by the actual value for that row,
and will separate them using HTML's <br> tag, which will make plotly present
each variable in a new line. We then build the ggplot object as before, with the
addition of the text aesthetic (which will produce a warning, but let's not
worry about that) and then, instead of ploting it, we use plotly's ggplotly
function.

And we get something like this:

That's it. We can now explore our data (including the original values before the
t-SNE transformation) in a visual way, much faster than having to go back and
forth to the initial data.frame.