 Multidimensional scaling aims to preserve all the distances from the original data space, meaning it tries to maintain both the distances between neighboring data points and between the data points that are far apart. In life, we often only care about things that are close together. Anything far away is just far away, and the exact distances don't really matter. For example, I care how close my home and workplace are, as traveling half an hour or less makes a huge difference. But if I drove from my home in Ljubljana to Paris, 30 minutes wouldn't really matter to me on a 14 hour trip. Paris is just far away. Similarly, in data visualization, anything close together should matter more. Do we really worry about retaining each individual distance, or are we just interested in exposing data instances that are close to one another? For example, if we're looking for the clustering structure of some data, then all we really want is to clump together the data that's close enough. Consider this data with a couple of obvious clusters. First, I use the distances widget to compute the pairwise distances between each point. Then I use the MDS widget to take those distances and create a map. Now as I'm using a two-dimensional data set, I expect MDS to recreate it exactly. So I'll just leave these two images here side by side so you can clearly see that they are indeed the same, if a little rotated. Moving on, I'll try out another visualization tool, the so-called T-distributed Stochastic Neighbor Embedding, or T-SNE for short. Now T-SNE only cares about neighbors. In this visualization, the idea is that the points that were nearby in the original space will stay close together. So let's give it a shot. I can connect my original data to the T-SNE widget and see that the nearby points are still clumped together. This clumping is controlled by the exaggeration parameter. So take a look at what happens if I emphasize the locality even more by raising the exaggeration to 2. Okay, let's change it back to 1. Now a few side notes before moving on. First, note that the MDS widget can be connected to the data source directly without computing distances explicitly. The result in this situation is the same as using the distance widget with Euclidean distance. And second, while T-SNE also requires the distances, the current implementation in orange computes Euclidean distances directly from the data so it can't actually receive distances on its input. Anyway, I'm now curious to see what T-SNE would do with the Zoo dataset we've been using in our last couple of videos. So starting off with an empty canvas, I can load the Zoo dataset from the dataset's widget and connect it straight to T-SNE. I also see it colors the data by animal type. And I see no overlaps. The mammals, the fish, the birds, and even the invertebrates are all in their own cluster. Now compare this embedding to what we got from MDS. I'll just make sure the points are colored according to animal type. I'll hide the control areas and put the windows side by side. You can see the difference isn't really staggering, but it does seem that T-SNE did a bit of a better job clustering the same types together. T-SNE and MDS seem similar in two dimensions, but the difference is more pronounced with larger datasets. We'll talk about this more in our next videos, but for now I'll just conclude by explaining where the name T-SNE, or T-distributed stochastic neighbor embedding actually comes from. So it's an embedding. This means it places data points in a smaller space, in our case a two-dimensional one, by optimizing their locality. And it does this by looking at each point's neighbors. Also stochastic just means that there's an aspect of randomness. In this case it's because we initialize it with random points. And finally the T comes from the T-distribution, which is used to determine the importance of each neighbor. The main takeaway here is that MDS preserves the distances, while T-SNE preserves each point's neighbors.