Constraint-based clustering selection

Toon van Craenendonck, Hendrik Blockeel

Abstract

Clustering is a fundamental yet subjective task in machine learning, often requiring tedious hyperparameter tuning and domain expertise. While semi-supervised clustering methods attempt to incorporate user constraints into the optimization process, they are frequently limited by the inherent biases of the underlying algorithms. This paper introduces COBS (Constraint-Based Selection), a framework that shifts the focus from modifying algorithms to selecting the most appropriate unsupervised clustering from a diverse library based on a small set of user-provided constraints. Our results demonstrate that COBS consistently outperforms state-of-the-art semi-supervised methods across various artificial and real-world datasets.

Introduction

The "no free lunch" theorem in unsupervised learning implies that no single clustering algorithm is universally superior. Practitioners must navigate a complex space of distance metrics, algorithms (e.g., K-means, DBSCAN, Spectral Clustering), and hyperparameters. Traditional semi-supervised approaches incorporate "Must-Link" (ML) and "Cannot-Link" (CL) constraints by altering objective functions or learning new distance metrics. However, these methods often fail when the algorithm's fundamental bias—such as K-means' preference for spherical clusters—conflicts with the data's actual structure.

Methods: The COBS Framework

COBS addresses this by treating clustering as a selection problem rather than an optimization problem. The workflow consists of three main stages:

  1. Library Generation: A large pool of candidate clusterings is generated by running multiple unsupervised algorithms across a broad spectrum of hyperparameter settings.
  2. Constraint-Based Selection: Given a set of ML and CL constraints, COBS evaluates each candidate in the pool. The clustering that satisfies the maximum number of constraints is selected as the final output.
  3. Active Learning (Active COBS): To minimize user effort, an active learning strategy identifies pairs of points where candidate clusterings exhibit the highest disagreement (uncertainty sampling). This iterative process rewards clusterings that align with user feedback, efficiently narrowing down the best candidate.

Experimental Setup

The authors evaluated COBS using a diverse set of benchmarks:

  • Artificial Datasets: Five 2D sets with complex, non-convex shapes (e.g., jain, flame, cure-t2-4k) were used to visualize algorithm performance on manifold data.
  • Real-World Datasets: Fourteen datasets from the UCI repository, including wine, iris, and breast-cancer.
  • High-Dimensional Data: Image data (faces via Inception-V3) and text data (newsgroups via TF-IDF/LSI).
Figure 4: A non-convex 'moons' dataset illustrating where traditional spherical-bias algorithms like K-means often fail without proper selection.

Key Insights

The primary finding is that bias beats optimization. Selecting an algorithm whose inherent geometric bias matches the data structure is more effective than forcing an ill-suited algorithm to respect constraints. By treating hyperparameters as an asset rather than a burden, COBS creates a "menu" of potential structures. Furthermore, the study highlights that internal quality metrics like the Silhouette index are often unreliable for capturing user intent, whereas simple constraints provide a direct bridge to subjective goals.

Figure 6: A complex synthetic dataset used to test the robustness of COBS in identifying diverse cluster shapes and densities.

Results and Discussion

COBS demonstrated superior performance over specialized semi-supervised algorithms such as MPCKMeans, COSC, and FOSC. It proved particularly robust on datasets where only a specific algorithm type (e.g., DBSCAN) was appropriate. The Active COBS strategy significantly reduced the number of constraints needed; for instance, on the dermatology dataset, it achieved an Adjusted Rand Index (ARI) of ~0.80 with only five constraints.

Despite its success, COBS is limited by the quality of its initial pool. If the "true" clustering is not represented in the unsupervised runs, the selection will be suboptimal. Additionally, while generating hundreds of clusterings is computationally intensive, the process is embarrassingly parallel and can be performed offline.

Conclusion

COBS offers a simple, effective alternative to complex semi-supervised clustering. By leveraging the diversity of unsupervised algorithms and using constraints for selection rather than optimization, it provides a robust path toward satisfying user-specific clustering requirements with minimal manual intervention.

Summary updated

BibTeX
@article{craenendonck2017constraint,
  author = {Toon van Craenendonck and Hendrik Blockeel},
  title = {{Constraint-based clustering selection}},
  journal = {Machine Learning},
  year = {2017},
  doi = {10.1007/s10994-017-5643-7},
}
Figure