---
title: Overlap Number of Balls (ONB) Analysis
url: https://www.emergentmind.com/topics/overlap-number-of-balls-onb
type: topic
---

# Overlap Number of Balls (ONB) Analysis

The Overlap Number of Balls (ONB) quantifies the geometric and combinatorial overlap between distinct classes or groups within a set—whether in statistical learning, combinatorial allocation, or urn models—by measuring the minimal number of non-overlapping, class-pure balls (hyperspheres) required to cover each class such that no ball contains points from more than one class. The ONB framework is used extensively in data complexity analysis, overlap quantification, and applied probability, with variations tailored to classification geometry, probability of collisions in random allocations, and partition thresholds in combinatorial settings [2407.14210][2007.07935][1905.06663][1209.5764].

## 1. Mathematical Definitions and Algorithmic Construction

The core ONB construction begins with a labeled dataset $D = \{(x_1, y_1), \ldots, (x_n, y_n)\} \subset \mathbb{R}^d \times \{1, \ldots, k\}$ for $k$ classes. For a given $x_i$ of class $y_i$, the "safe-radius" $r_i$ is defined as the minimal distance to any point of a different class:
\[
r_i = \min_{j: y_j \ne y_i} \|x_i - x_j\|.
\]
The corresponding closed ball is $B_i = \{x \in \mathbb{R}^d : \|x - x_i\| \le r_i\}$. The set of all points of class $k$ is $X_k$. To cover $X_k$, the algorithm greedily selects balls that maximize the number of yet-uncovered points in $X_k$, breaking ties by radius if needed, and removes newly covered points from consideration. The process iterates until all points in $X_k$ are covered. The number of selected balls, $N_k$, is the ONB for class $k$ [2407.14210][2007.07935].

Associated to each covering ball are three attributes:
- **Radius ($r_i$):** indicates local class-separation.
- **Covered instances ($m_i = |B_i \cap X_k|$):** quantifies local point density.
- **Density ($\delta_i = m_i / Vol(B_i)$):** signals tightness of local packing, relevant for outlier and boundary detection.

## 2. ONB as a Data Complexity Metric

ONB metrics offer a tunable, geometry-aware quantification of class overlap and boundary complexity. Heavy class overlap leads to small $r_i$ and large $N_k$, as many small balls are required to maintain class-purity. Well-separated classes yield large $r_i$ and minimal $N_k$. Main variants summarized in [2007.07935] include:

| Metric                | Formula                                                       | Typical Use          |
|-----------------------|---------------------------------------------------------------|----------------------|
| $ONB_{tot}$           | $\dfrac{\sum_{i=1}^k b_i}{n}$                                 | Global overlap       |
| $ONB_{avg}$           | $\dfrac{1}{k}\sum_{i=1}^k \dfrac{b_i}{n_i}$                   | Class-level overlap  |
| Distance choices      | Euclidean ($\|\cdot\|_2$) or Manhattan ($\|\cdot\|_1$)        | Data-dependent       |

Empirically, the Manhattan-distance class-averaged ONB $(ONB_{avg}^{man})$ demonstrates the strongest negative correlation with 1NN geometric mean performance across both synthetic and real-world datasets ($\rho \approx -0.997$ in balanced artificial data) [2007.07935].

## 3. Theoretical Properties and Interpretations

Several monotonicity and tradeoff properties hold:
- **Monotonicity:** As class overlap increases, ONB increases; as classes become more separable, ONB decreases.
- **Radius–Overlap Trade-off:** The average ball radius $\bar{r}_k$ for covering class $k$ is inversely related to overlap—more overlap means smaller $\bar{r}_k$.
- **Bounds:** $0 < ONB_{\bullet} \le 1$, with $ONB \to 1$ under maximal overlap (each point requires its own ball), and $ONB \approx 0$ for fully disjoint classes [2407.14210][2007.07935].
- **Boundary Complexity:** ONB simultaneously captures local (microscopic) and global (macroscopic) structural complexity at class boundaries.

ONB values correlate strongly with classification difficulty. Instance-based methods (e.g., kNN) suffer most in high-ONB regimes, where boundaries are intricate or classes interpenetrate. This behavior is validated empirically, as ONB provides better prediction of classifier performance than alternatives such as MST- or nearest-neighbor-based complexity measures [2007.07935].

## 4. Computational Complexity and Practical Implementations

The dominant complexity arises from distance computations and the covering procedure:
- **Pairwise distances:** $O(n^2d)$ for $n$ points in $d$ dimensions.
- **Cover construction:** per class, each step may require $O(n)$ scans, possibly up to $N_k = O(n)$ steps, yielding $O(n^2)$ complexity total in the worst case.
- **Accelerations:** For moderate $n$, practical implementations leverage spatial indices (e.g., kd-trees) or approximate nearest-neighbor techniques to expedite range queries and nearest-opposite computation [2407.14210][2007.07935].
- **Parameterization:** The metric is robust to distance choice and agnostic to scale, but boundary region identification may require percentile-based thresholding of radius, coverage, or density.

## 5. Extensions: Singular Models and Generalizations

The ONB paradigm generalizes naturally to:
- **Multi-label:** Restricting ball covers to label-overlap constraints [2007.07935].
- **Multi-instance:** Treating each bag as a composite entity, with covering applied in bag space.
- **Multi-view:** Requiring that balls capture proximity in all feature spaces jointly.
- **Singular problems:** Ball coverage schemes can be adapted to account for more intricate or non-Euclidean relational structures.

In applied probability, analogous "ONB" statistics arise in urn models, where overflow quantifies the number of assignments of balls to urns (with capacity $r$) that result in overfilling. Exact asymptotic formulas and limit laws (Poisson or Gaussian) for these collision/overflow statistics are derived under varying scaling regimes for $n$ balls and $k$ urns [1905.06663].

## 6. Combinatorial Thresholds and ONB in Allocation Problems

In combinatorics, the ONB concept maps to sharp thresholds for the emergence of overlapping box occupancies:
- **Model-dependent thresholds:** For $n$ balls and $k$ boxes (distinguishable/indistinguishable, surjective, etc.), the ONB represents the maximal box count $k=k(n)$ where the probability of any two boxes coinciding in occupancy remains bounded away from zero.
- **Sample results** [1209.5764]:

| Model                          | Threshold for ONB     |
|--------------------------------|-----------------------|
| Compositions                   | $k \sim n$            |
| Integer partitions             | $k \sim n^{1/3}$      |
| Surjections / set partitions   | $k \sim n^{1/2}$      |

Each model exhibits a sharp phase transition: as $k$ crosses the threshold, the probability of occupancy overlap jumps from $o(1)$ to $1-o(1)$.

## 7. Applications: Fairness, Bias Reduction, and Data Preprocessing

In the context of fair machine learning, the ONB has been adapted into the Fair-ONB method, which targets bias reduction by undersampling regions of greatest overlap—those closest to decision boundaries or with minimal class-purity—according to ball attributes (radius, coverage, and density) [2407.14210]. The procedure identifies high-overlap ("worst") regions by percentile filtering and removes or relabels associated instances, thus enhancing model fairness with minimal predictive performance degradation.

ONB and its filtered variants have been empirically validated to:
- Improve class-balanced representation across protected groups.
- Reduce bias in algorithmic decisions rooted in training set geometry.
- Offer instance selection strategies superior to random or naive undersampling in maximizing fairness while preserving classification utility [2407.14210].

---

**References:**
- [2407.14210] Fair Overlap Number of Balls (Fair-ONB): A Data-Morphology-based Undersampling Method for Bias Reduction
- [2007.07935] Revisiting Data Complexity Metrics Based on Morphology for Overlap and Imbalance: Snapshot, New Overlap Number of Balls Metrics and Singular Problems Prospect
- [1905.06663] Asymptotics of the overflow in urn models
- [1209.5764] Threshold functions for distinct parts: revisiting Erdos-Lehner

Source: https://www.emergentmind.com/topics/overlap-number-of-balls-onb