← 10. Patterns & segmentation
Dimensionality reduction maps
Try this analysis →

MDS·t-SNE·UMAP

If you know what a method is trying to preserve, you will not misread the map.

MDS · stressPerplexityn_neighborsLimits of interpretation

MDSpreserves distancescontinuous spreadt-SNEpreserves neighborstight clumpsUMAPneighbors + global structureconnected users

Suppose we are analyzing the listening patterns of 2,000 users of a music streaming service. Some people listen to calm music for long stretches, while others play short dance tracks over and over. Still other users listen evenly to jazz and classical music or frequently look for new artists.

If user characteristics are summarized as 15 variables, such as genre preferences, average track length, skip rate, daily listening time and new-release exploration rate, how can we see at a glance how similar the users are to one another? You can look through 15-dimensional data in a table, but it is hard to grasp intuitively how similar the users are.

Methods you can use here are multidimensional scaling (Multidimensional Scaling, MDS), t-SNE (t-distributed Stochastic Neighbor Embedding) and UMAP (Uniform Manifold Approximation and Projection). All three represent high-dimensional data in 2 or 3 dimensions to help you examine the relationships among observations, but they differ in what they try to preserve and in how their results should be interpreted.

In this article we use a single example to compare the three methods' principles, when to use them, distances and preprocessing, key settings, how to read the resulting plots, and their limits and reproducibility.

SECTION 1

Why dimensionality reduction is needed

The more variables there are, the more detail you can give about each user, but the harder it becomes to grasp what structure the users form as a whole.

For example, two users may have similar genre preferences but different listening times, while two other users may have the same listening time but different skipping behavior.

Users × 15 variables2,000 users × 15 columnsDimensionalityreductionSome informationis lost2-D map
From 15-dimensional data to a 2-D map

Dimensionality reduction (Dimensionality Reduction) is an approach that expresses the information in many variables with fewer axes. However, reducing the number of axes loses some information. So a dimensionality reduction plot should be understood not as a map that perfectly reconstructs the original data, but as a summary visualization built to emphasize particular relationships.

MDS tries to reproduce the distances or dissimilarities between observations as closely as possible. t-SNE places particular emphasis on close neighbor relationships, and UMAP builds a low-dimensional representation from the local neighborhood structure. Because their goals differ, the three plots can look different even for the same data.

SECTION 2

Real-world example: music users' listening patterns

Suppose we sampled 2,000 users who were active on a streaming service in the last 30 days.

Each person forms one row, and 15 main variables are used. These include, for example, the share of listening to pop, hip-hop, jazz, classical and electronic music, average daily listening time, skip rate, repeat-play rate and new-release exploration rate.

ItemSetting
Unit of analysisOne user
Observations2,000 users
Input variables15 listening behavior and preference variables
Visualization dimensions2-D
Research purposeExplore how similar listening patterns are distributed
Methods comparedMDS, t-SNE, UMAP

The goal of this example is not to predict purchases or to classify customers into predefined groups. It is an exploratory analysis of how users with similar listening characteristics are arranged on a low-dimensional map. Using the results later for marketing or recommendation systems would require separate validation.

SECTION 3

Decide on distances and preprocessing before the analysis

All three methods are strongly affected by how similarity between users is defined.

So first check the units and distributions of the variables. If daily listening time is recorded in minutes and genre preference shares are recorded from 0 to 1, computing Euclidean distances without any adjustment can let listening time dominate the distances.

Before adjustment78%After adjustment22%17%16%17%28%Listening time (min)Skip rateRepeat-play rateNew-release rate11 genre preferences
Contribution to distance by preprocessing

Continuous variables can be standardized or robustly scaled depending on the purpose. For compositional data that sum to 1, such as genre shares, you should also consider distances that account for the nature of proportions.

Handling missing values and checking for extreme values are also necessary. To keep the explanation simple, this example assumes we use 15 input values whose meanings have been reviewed and that have been appropriately transformed and standardized.

Preprocessing itemWhat to check
Variable selectionExclude redundant variables and variables irrelevant to the purpose of the analysis
Unit adjustmentCheck that minutes, counts and proportions do not dominate the distance calculation
Missing valuesChanges in user composition from exclusion or imputation
Distance measureEuclidean, cosine, a predefined dissimilarity, etc.
ReproducibilityRecord the variables used, transformations and random seeds

Above all, before changing algorithms, decide which users you consider similar.

If the definition of distance changes, the nearest neighbors themselves can change.

SECTION 4

What does MDS preserve?

Multidimensional scaling (MDS) finds positions for the points so that the distances or dissimilarities between observations are kept as much as possible in a low-dimensional space.

If users A and B are similar in the original data, it tries to show them close together on the map, and if they are quite different, relatively far apart.

Original dissimilarity →Map distance ↑Line of perfect agreement
Original dissimilarity and map distance

Classical MDS (Classical MDS) constructs coordinates from a suitable Euclidean distance matrix. Metric MDS (Metric MDS) arranges points to reduce the mismatch between the given distances and the distances on the map, while nonmetric MDS (Nonmetric MDS) focuses mainly on preserving the rank order of the dissimilarities.

In MDS you can check fit measures such as stress (Stress). A smaller stress tends to mean that the low-dimensional coordinates better reflect the original dissimilarities under the chosen definition, but how to interpret the number depends on the type of stress and how it is normalized.

So you should not simply compare values from different programs on the same scale.

SECTION 5

What does t-SNE preserve?

t-SNE matches probabilistic similarity structures so that observations that are close in high dimensions also become close neighbors in low dimensions.

It is useful for finding and visualizing similar users nearby, and it helps you spot locally dense patterns in high-dimensional data.

The key setting, perplexity (Perplexity), relates to the effective size of the neighborhood each observation considers. You can compare several values, such as 15, 30 and 50, but there is no optimal value that works for all data. The appropriate value depends on the sample size, density and the structure you are interested in.

153050Perplexity →
t-SNE by perplexity

What requires particular care in t-SNE plots is that the gaps between clumps, the areas of clumps and differences in point density must not be read directly as distances between groups or group sizes in the original data.

Because it prioritizes preserving close neighbor relationships, global distances and shapes can be heavily distorted.

SECTION 6

What does UMAP preserve?

UMAP builds a relational structure from the nearest neighbors in high-dimensional data and lays it out in low dimensions.

It represents mainly the local structure of the data, and depending on its settings it can also explore relatively broader structure.

The main settings are n_neighbors and min_dist. n_neighbors affects the range of neighbors considered when capturing the structure around each observation. Small values can tilt the emphasis toward more local patterns, and large values toward broader relationships.

min_dist affects how tightly points can pack together in low dimensions.

min_dist 0.05Tightly packedmin_dist 0.5Widely spread
UMAP by min_dist

For example, n_neighbors=30, min_dist=0.1 is just one setting to start experimenting with, not the right answer. With UMAP too, the distances between clumps and their areas in the plot must not be treated like physical distances in the original space.

SECTION 7

How do the three methods compare at a glance?

Rather than ranking as substitutes for one another, the three are visualization methods that preserve different things.

Comparison itemMDSt-SNEUMAP
Main purposeReproduce distance/dissimilarity relationshipsEmphasize close neighbor relationshipsLow-dimensional representation of nearest-neighbor structure
Main inputDistance/dissimilarity matrix or observationsObservations or distance informationObservations or distance information
Typical settingsNumber of dimensions, distance, stress criterionPerplexity, learning rate, initializationn_neighbors, min_dist, distance
StrengthsEasy to explain the relationship to the original dissimilaritiesVisualizes local patterns and nearby neighborsExplores neighbor structure at various scales
CautionsCannot fit all high-dimensional distances into 2-DRisky to interpret distances and sizes between clumpsSensitive to settings and stochastic optimization

MDS does not always preserve the overall structure best, and UMAP is not always faster or more accurate than t-SNE. Results depend on the size of the data, the implementation, the distance measure and the settings.

SECTION 8

How do you read the resulting plots?

Even for the same data, the MDS, t-SNE and UMAP maps take different shapes.

Suppose the MDS map showed users in a gradual, continuous spread according to genre preference and listening time. In the t-SNE map, users who mainly listen to calm music and users who repeatedly play music with a strong beat were each placed in relatively dense regions.

In UMAP, we can suppose that similar local groups appeared, with some users forming a bridge connecting the two regions.

MDScontinuous spreadt-SNEtight clumpsUMAPconnected userspreserves distancespreserves neighborsneighbors + global structure
Three maps of the same data

When interpreting the three plots, it is important not to attach meaning to the coordinate values themselves. A value of 12 on the first t-SNE axis does not mean a listening time of 12 hours. The plots can be arbitrarily rotated, reflected and shifted, and even with the same data the positions can change with the run conditions.

Also, visually separated clumps must not immediately be called definitive customer segments. Only by coloring the points by existing genre preferences or usage frequency, and comparing the distributions of the original variables in each region, can you learn what characteristics are actually reflected.

SECTION 9

Let's check the example results with the actual variables

Suppose that after the visualization, reviewing users who were close on the maps revealed the following three prominent patterns.

The groups below are exploratory profiles organized by the original variables for illustration; they are not definitive clusters produced automatically by MDS, t-SNE or UMAP.

Exploratory profileNumber of usersAverage daily listening timeNew-release exploration rateKey characteristics
Familiar-track repeaters72084 min12%High share of repeat plays
New-release explorers560106 min48%Frequently listen to new artists
Long background listeners720178 min20%Much long continuous playback
Total2,000 users———
60 min100 min140 min180 min0%20%40%60%Familiar-track repeaters720New-release explorers560Long background listeners720Daily listening time →New-release rate
Comparing the exploratory profiles

This table is an example of using the original variables to check why the points in each region clustered together. Whether the three profiles are stable segments that actually exist requires a separate cluster analysis and reproducibility assessment. Visualization alone cannot prove statistical differences or causal relationships between the profiles.

SECTION 10

Do the results change if you change key settings?

The results of all three methods are affected not only by the distance measure and input variables but also by the analysis settings.

In particular, the shape of t-SNE and UMAP plots can change with the initialization, the random numbers and the neighborhood size.

For example, you can try t-SNE perplexities of 15, 30 and 50, or compare UMAP n_neighbors values of 15, 30 and 60. In doing so, you must not choose a setting just because a particular picture looks nicer.

Check whether neighbor relationships stay stable in line with the purpose of the analysis and whether they are consistent with the patterns in the original variables. In MDS too, the stress and the arrangement of points change with the dissimilarity you input and the number of dimensions you use. For settings and reproducibility, it is good to record the version of the implementation used, the random seed and the preprocessing steps.

SECTION 11

How does it differ from PCA?

Principal component analysis (PCA), covered earlier, creates new orthogonal components as linear combinations of the original variables.

You can calculate the variance each component explains, and the loadings show which original variables contribute to that component.

MDS, t-SNE and UMAP, on the other hand, focus on representing distances or neighbor relationships between observations in low dimensions. In particular, the axes of t-SNE and UMAP do not provide explained variance ratios and clear linear loadings the way PCA's principal components do.

PCA can be used as a standalone exploratory method, or as a preliminary dimensionality reduction step to reduce noise and computational load before applying t-SNE or UMAP. But applying PCA first removes some information, so you should also check that fine structure that matters in the original space is not lost.

SECTION 12

Things to watch out for when using dimensionality reduction

Being far apart in the picture does not necessarily mean being very different in the original data.

This gapThis area✓Neighbor relationships✓Trends colored by original variables✗Distances between clumps✗Clump area · density✗Axis numbers✗Separation = definitive clusters
Cautions in reading the map

It is especially risky to compare global distances and the sizes and shapes of clumps directly in t-SNE and UMAP. MDS can also distort distances through dimensionality reduction, so check the stress and how well the original distances are reproduced.

Points that look separated do not prove that real clusters exist.

To decide the number and boundaries of clusters, you need analysis of the original features and a separate review of cluster stability. Also, if you form groups after the visualization and then test them again on the same data, selection bias can arise.

Preprocessing and the distance measure have a big effect on the results.

If time, counts and proportions are not adjusted appropriately, certain variables can dominate the similarity. It is good to check that neighbor relationships are stable across several settings.

A 2-D visualization is not a complete copy of the original data.

Reducing complex high-dimensional relationships distorts part of the structure, so when making important decisions you should also use the original variables and separate evaluations.

SECTION 13

How do you report the results?

When reporting dimensionality reduction results, it is good to state the sample size, the variables used, preprocessing, the distance measure, the algorithm settings, the random seeds and so on.

For MDS you can describe fit information such as stress, and for t-SNE and UMAP the key settings and the stability across several settings.

Example results report

To visualize the listening patterns of 2,000 music streaming users, MDS, t-SNE and UMAP were applied using 15 listening behavior and genre preference variables. Taking the units and distributions of the variables into account, the data were transformed and standardized beforehand, and 2-D coordinates were then estimated with each method. The visualizations were reviewed with a focus on the overall dissimilarity relationships among users for MDS and on the arrangement of close neighbors for t-SNE and UMAP.

Comparing the distributions of the original variables afterward, distinct listening patterns were identified in an exploratory way, such as users with a high share of repeat plays, users with a high new-release exploration rate and users with long continuous playback. However, we did not conclude that definitive customer clusters exist from the separation seen on the low-dimensional maps alone, and we examined the stability of the arrangement across analysis settings together with the distributions of the original variables.

In a real analysis, add the settings for each algorithm and the MDS fit values.

✓Wrap-up

Choose a method based on the relationships you want to see

MDS, t-SNE and UMAP arrange data described by many variables in 2 or 3 dimensions so you can examine the relationships among observations.


MDS focuses on reproducing distance and dissimilarity relationships, t-SNE emphasizes close neighbors, and UMAP builds a low-dimensional representation based on nearest-neighbor structure.

But the shape of a visualization does not prove the actual group structure of the data. The arrangement can change with the settings and distance measure, and you should be especially careful about reading distances or areas between clumps as quantitative differences in the original space.

KEY TAKEAWAY

The key is not to pick the most striking picture, but to choose a definition of similarity that fits the purpose of the analysis and to verify the patterns found on the low-dimensional map against the original data.