Clustering over Multi-Objective Samples: The one2all Sample

Edith Cohen, Shiri Chechik, Haim Kaplan

Abstract

Clustering massive datasets is a fundamental challenge in data analysis. Traditional "coreset" methods often rely on worst-case theoretical bounds that lead to impractically large sample sizes. We introduce one2all, a novel adaptive sampling technique that leverages the inherent structure of data to create small surrogate samples with strong statistical guarantees. By shifting from pessimistic "ForAll" guarantees to adaptive "ForEach" guarantees, one2all achieves significant reductions in sample size—up to 94x—while maintaining high accuracy for cost estimation and clustering tasks.

Introduction

Clustering algorithms, such as $k$-means, are computationally intensive because they require repeated distance calculations between every data point and a set of centroids. To scale these algorithms, researchers use coresets—small, weighted samples that approximate the full dataset's cost. However, standard coreset constructions are often based on worst-case scenarios, assuming pathological data distributions. This results in sample sizes that can be nearly as large as the original dataset, defeating the purpose of sampling.

We address this by asking: Can we obtain strong statistical guarantees using much smaller samples by adapting to the actual structure of real-world data? Our solution is the one2all construction, which uses an adaptive design to balance sample size and accuracy.

The one2all Construction

The core of our approach is multi-objective probability-proportional-to-size (pps) sampling. We consider data points $X$ in a relaxed metric space, where the triangle inequality holds within a constant factor. The cost of clustering $X$ by a set of centroids $Q$ is defined as $V(Q) = \sum_{x \in X} d(x, Q)$.

Instead of trying to accurately estimate the cost of every possible set of $k$ centroids (a "ForAll" guarantee), we focus on providing accurate estimates for any specific query (a "ForEach" guarantee). The one2all method takes a reference set of centroids $M$ and an approximation factor $\alpha \geq 1$. It efficiently assigns sampling probabilities to points so that the clustering cost of each $Q$ with $V(Q) \geq V(M)/\alpha$ can be estimated well from a sample of size $O(\alpha |M|\epsilon^{-2})$.

Illustration of the one2all sampling logic, where reference centroids (red) help define sampling probabilities for data points (black) to accurately estimate costs for various queries (blue).

Mathematically, this single set of probabilities upper-bounds the required probabilities for all potential centroid sets with a cost comparable to $M$. This allows the sample to act as a reliable surrogate for a wide range of potential clustering solutions.

Adaptive Frameworks

We implement one2all within two adaptive frameworks designed to minimize sample size based on data complexity:

  1. Adaptive Cost Oracle: For estimating clustering costs, the algorithm starts with an optimistically small sample. If a queried clustering has a cost lower than what the current sample size can reliably estimate, it triggers a "feedback" mechanism to compute the exact cost and adaptively increase the sample size.
  2. Adaptive Clustering Wrapper: This meta-algorithm wraps around any base clustering algorithm (like Lloyd's algorithm). It runs the base algorithm on a small one2all sample and then tests the resulting centroids against the full dataset. If the algorithm was "fooled" by the sample (i.e., the sample cost is vastly different from the true cost), the wrapper doubles the sample size and tries again.

Experimental Results

We evaluated the one2all method on synthetic Gaussian mixtures and real-world datasets like MNIST and Fashion MNIST. The results demonstrate massive efficiency gains over traditional worst-case bounds:

  • MNIST: While worst-case bounds required 100% of the data (providing zero reduction), one2all achieved the same guarantees using only 3.7% of the data—a 26.9x gain in efficiency.
  • Fashion MNIST: The method used only 5.7% of the data, a 17.5x gain over worst-case methods.
  • Synthetic Data: On highly clusterable data, we observed up to a 94.4x reduction in sample size.

Crucially, these smaller samples did not sacrifice accuracy; relative errors remained well below the specified tolerance ($\epsilon$).

Conclusion

The one2all construction demonstrates that worst-case bounds are often overkill for real-world data. By using a single reference set to capture data structure and employing adaptive mechanisms, we can drastically reduce the computational overhead of clustering. Future work may extend these multi-objective sampling techniques to other low-rank approximation problems like PCA and SVD.

Summary updated

Abstract

Clustering of data points is a fundamental tool in data analysis. We consider points $X$ in a relaxed metric space, where the triangle inequality holds within a constant factor. The {\em cost} of clustering $X$ by $Q$ is $V(Q)=\sum_{x\in X} d_{xQ}$. Two basic tasks, parametrized by $k \geq 1$, are {\em cost estimation}, which returns (approximate) $V(Q)$ for queries $Q$ such that $|Q|=k$ and {\em clustering}, which returns an (approximate) minimizer of $V(Q)$ of size $|Q|=k$. With very large data sets $X$, we seek efficient constructions of small samples that act as surrogates to the full data for performing these tasks. Existing constructions that provide quality guarantees are either worst-case, and unable to benefit from structure of real data sets, or make explicit strong assumptions on the structure. We show here how to avoid both these pitfalls using adaptive designs. At the core of our design is the {\em one2all} construction of multi-objective probability-proportional-to-size (pps) samples: Given a set $M$ of centroids and $\alpha \geq 1$, one2all efficiently assigns probabilities to points so that the clustering cost of {\em each} $Q$ with cost $V(Q) \geq V(M)/\alpha$ can be estimated well from a sample of size $O(\alpha |M|\epsilon^{-2})$. For cost queries, we can obtain worst-case sample size $O(k\epsilon^{-2})$ by applying one2all to a bicriteria approximation $M$, but we adaptively balance $|M|$ and $\alpha$ to further reduce sample size. For clustering, we design an adaptive wrapper that applies a base clustering algorithm to a sample $S$. Our wrapper uses the smallest sample that provides statistical guarantees that the quality of the clustering on the sample carries over to the full data set. We demonstrate experimentally the huge gains of using our adaptive instead of worst-case methods.
BibTeX
@misc{cohen2017clustering,
  author = {Edith Cohen and Shiri Chechik and Haim Kaplan},
  title = {{Clustering over Multi-Objective Samples: The one2all Sample}},
  year = {2017},
  eprint = {1706.03607},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1706.03607},
}
Figure