Abstract
Clustering is a fundamental tool in data analysis. We consider points $X$ in a relaxed metric space and address two primary tasks: cost estimation and clustering optimization. To handle massive datasets, we develop efficient constructions of small samples that serve as surrogates for the full data. We introduce the one2all construction of multi-objective probability-proportional-to-size (pps) samples. This method allows the clustering cost of any query $Q$ to be estimated accurately from a small sample. Furthermore, we design an adaptive wrapper that applies base clustering algorithms to the smallest possible sample that provides statistical guarantees. Experimental results show that our adaptive methods achieve sample sizes up to 90x smaller than worst-case theoretical bounds.
Introduction
As datasets scale to millions of points, traditional clustering algorithms like $k$-means become computationally prohibitive. Coresets—small, weighted samples that approximate the full dataset—are the standard solution. However, existing coreset constructions often suffer from a "Goldilocks" problem: they are either based on worst-case bounds that result in unnecessarily large samples, or they rely on restrictive distributional assumptions.
This work introduces an adaptive approach that leverages the inherent structure of real-world data to minimize sample size while maintaining rigorous quality guarantees.
Methodology
The One2all Construction
The core of our design is the one2all construction. Standard pps sampling is effective for estimating the cost of a single clustering, but fails when the goal is to estimate costs for all possible clusterings of size $k$.
The one2all method efficiently assigns sampling probabilities to points based on a set of "anchor" centroids $M$. It ensures that for any clustering $Q$ with a cost $V(Q)$ comparable to $V(M)$, the cost can be estimated accurately from a sample of size $O(\alpha |M| \epsilon^{-2})$. A key theoretical contribution is proving that the overhead for this multi-objective estimation is independent of the data's dimensionality.
The Adaptive Wrapper
To further optimize efficiency, we implement an adaptive wrapper for clustering tasks. Instead of relying on a fixed sample size, the wrapper:
- Initializes: Generates an initial small sample using a quick pass (e.g., $k$-means++).
- Clusters: Performs clustering on this sample.
- Validates: Tests the resulting centroids against the full dataset (or a validation sample) to verify if the error $\epsilon$ is within bounds.
- Adapts: If the guarantee is not met, it adaptively increases the sample size and repeats the process.
This feedback loop ensures the algorithm uses the minimum sample size required for the specific dataset's structure.
Experimental Evaluation
The method was evaluated on synthetic Gaussian mixtures and real-world datasets including MNIST and Fashion MNIST (600,000 images each).
Key Results
- Efficiency Gains: The adaptive method achieved sample sizes 16x to 94x smaller than those suggested by worst-case coreset theory.
- Dimensionality Independence: Performance remained robust even on high-dimensional data (e.g., $d=784$ for MNIST), confirming that the sample size depends primarily on $k$ and $\epsilon$.
- Accuracy: On MNIST, a sample of only ~3.7% of the data was sufficient to provide a 20% quality guarantee, with actual errors consistently falling well below the requested $\epsilon$.
Conclusion
The one2all construction and adaptive wrapper provide a powerful framework for scaling clustering to massive datasets. By moving away from worst-case bounds and toward data-dependent adaptivity, we can achieve significant computational savings without sacrificing theoretical rigor. Future work includes extending these sketching techniques to other data analysis tasks such as quantile aggregates and weighted Jaccard similarity.
Summary updated