Wasserstein t-SNE
Fynn Bachmann, Philipp Hennig, Dmitry Kobak
TL;DR
Wasserstein t-SNE addresses visualization of hierarchical data where units are distributions over samples by computing pairwise unit distances with the Wasserstein metric and embedding the resulting matrix in 2D using $t$-SNE. The method offers a Gaussian-approximation route for scalable computation, with a tunable $\lambda$ that balances mean and covariance information, and an exact LP-based route for faithful distances at higher cost. Through synthetic HGMM simulations and a real 2017 German election dataset, the approach demonstrates improved clustering and reveals meaningful cross-regional correlation patterns that are not captured by unit means alone. The work provides practical, scalable tools for unit-level visualization in hierarchical datasets, with potential applications across social sciences and biomedical domains, and offers insight into when exact vs. approximate Wasserstein distances are preferable.
Abstract
Scientific datasets often have hierarchical structure: for example, in surveys, individual participants (samples) might be grouped at a higher level (units) such as their geographical region. In these settings, the interest is often in exploring the structure on the unit level rather than on the sample level. Units can be compared based on the distance between their means, however this ignores the within-unit distribution of samples. Here we develop an approach for exploratory analysis of hierarchical datasets using the Wasserstein distance metric that takes into account the shapes of within-unit distributions. We use t-SNE to construct 2D embeddings of the units, based on the matrix of pairwise Wasserstein distances between them. The distance matrix can be efficiently computed by approximating each unit with a Gaussian distribution, but we also provide a scalable method to compute exact Wasserstein distances. We use synthetic data to demonstrate the effectiveness of our Wasserstein t-SNE, and apply it to data from the 2017 German parliamentary election, considering polling stations as samples and voting districts as units. The resulting embedding uncovers meaningful structure in the data.
