math.STMar 15, 2026

K−K-means with learned metrics

Authors: Pablo Groisman, Matthieu Jonckheere, Jordan Serres, Mariela Sued

Abstract

We study the Fréchet k−k-means of a metric measure space when both the measure and the distance are unknown and have to be estimated. We prove a general result that states that the k−k-means are continuous with respect to the measured Gromov-Hausdorff topology. In this situation, we also prove a stability result for the Voronoi clusters they determine. We do not assume uniqueness of the set of k−k-means, but when it is unique, the results are stronger. This framework provides a unified approach to proving consistency for a wide range of metric learning procedures. As concrete applications, we obtain new consistency results for several important estimators that were previously unestablished, even when k=1k=1. These include k−k-means based on: (i) Isomap and Fermat geodesic distances on manifolds, (ii) difussion distances, (iii) Wasserstein distances computed with respect to learned ground metrics. Finally, we consider applications beyond the statistical inference paradigm like (iv) first passage percolation and (v) discrete approximations of length spaces.

Explore similar work

Jul 15, 2024

Faster and Simpler Greedy Algorithm for kk-Median and kk-Means

Clustering problems such as kk-means and kk-median are staples of unsupervised learning, and many algorithmic techniques have been developed to tackle their numerous aspects. In this paper, we focus on the class of greedy approximation algorithm, that attracted less attention than local-search or primal-dual counterparts. In particular, we study the recursive greedy algorithm developed by Mettu and Plaxton [SIAM J. Comp 2003]. We provide a simplification of the algorithm, allowing for faster implementation, in graph metrics or in Euclidean space, where our algorithm matches or improves the state-of-the-art.
Aug 11, 2026

Gromov-Wasserstein Quantization and Clustering: Structure, Rates, and Algorithms

Clustering is a fundamental class of data analysis techniques with the most important representatives being centroid-based methods like kk-means. Such methods are strongly connected to quantization problems, which aim to approximate general probability measures with discrete ones. For example, kk-means corresponds to quantization with respect to the Wasserstein distance. While Wasserstein quantization clusters points within a fixed space, this paper studies Gromov-Wasserstein (GW) quantization, which additionally aims at clustering the ambient geometry of the space. We show existence of solutions to the GW quantization problem and give a characterization that justifies an analogue to the kk-means algorithm (Lloyd's algorithm) to approximate them numerically. We further calculate the quantization rate for usual Euclidean geometries that are used in the GW context, and relate it to standard Wasserstein quantization rates. Finally, numerical experiments show that GW quantization opens up many modeling possibilities beyond normal clustering methods (e.g., for geodesic distances of 3D shapes or structured pruning of neural networks) and that the introduced algorithm leads to useful numerical solutions with approximation quality often in line with theoretically optimal rates.
Jun 9, 2026

kk-Nearest Neighbors in Gromov--Wasserstein Space

The Gromov--Wasserstein (GW) distance provides a framework for comparing metric measure spaces, regardless of their underlying structure or geometry. For network-based data, it enables direct comparisons of graphs with different numbers of nodes, without requiring an embedding or other abstraction. Furthermore, through a variant of GW known as fused Gromov--Wasserstein (fGW), it is also possible to incorporate node features in addition to graph structure. In this work, we implement kk-nearest neighbors (kk-NN) classification using the GW and fGW distances. We prove the universal consistency of the GW-kk-NN classifier on the space of equivalence classes of metric measure spaces with finite support and uniform probability measure. By viewing graphs as finitely supported metric measure spaces equipped with the pairwise distance metric and a uniform probability measure on the nodes, we obtain universal consistency of GW-kk-NN for the space of graphs. Likewise for fGW-kk-NN, we prove universal consistency on the space of weak isomorphism classes of structured objects consisting of metric measure spaces with finite support and uniform probability measure and feature maps into Euclidean space, thus establishing universal consistency on the space of node-attributed graphs. Our numerical experiments show that GW-kk-NN and fGW-kk-NN consistently perform well across multiple graph datasets, suggesting that metric classifiers such as kk-NN work well in the GW framework.