Papers
Topics
Authors
Recent
Search
2000 character limit reached

Weighted Distance NN Condensing

Updated 11 May 2026
  • Weighted Distance Nearest-Neighbor Condensing is a framework that uses learned positive weights to reduce dataset size in nearest-neighbor classification.
  • It achieves dramatic data compression while maintaining or improving accuracy, offering theoretical guarantees similar to classical condensing methods.
  • A greedy heuristic is commonly used to select representatives, though challenges remain in computational efficiency and approximation guarantees.

Weighted Distance Nearest-Neighbor Condensing (WNN) is a framework for data reduction in nearest-neighbor classification, generalizing traditional condensing by introducing learned, positive weights on representatives of the instance space. By leveraging weighted distances in the nearest-neighbor query, WNN enables more compact summarization of labeled datasets while preserving (or even improving) classification accuracy, and it achieves generalization performance guarantees essentially identical to those of standard nearest-neighbor condensing (Gottlieb et al., 2023).

1. Formal Foundations and Problem Statement

Let (X,d)(\mathcal X,d) be a separable metric space and S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\} a labeled sample. WNN condensing selects a subset S~S\tilde S \subseteq S (the condensed set) and assigns to each xS~x\in\tilde S a positive weight w(x)(0,)w(x) \in (0, \infty), with the convention w(x)=1w(x)=1 for x∉S~x\not\in \tilde S. Classification of a query qq employs the weighted distance: d~(q,s)=d(q,s)w(s)\tilde d(q,s) = \frac{d(q,s)}{w(s)} for sS~s \in \tilde S. The WNN classifier is

S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}0

A pair S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}1 forms a consistent WNN condensing if

S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}2

The weighted condensing problem seeks such a pair minimizing S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}3.

This construction generalizes unweighted nearest-neighbor condensing: setting S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}4 recovers the classical framework, while optimized weights may enable dramatically smaller condensed sets.

2. Theoretical Analysis and Generalization Properties

Separation of Representation Power

WNN provides potentially exponential gains in reduction compared to the unweighted regime. For any S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}5, there exist datasets S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}6 such that:

  • The minimal consistent unweighted subset must be of size S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}7.
  • A consistent WNN condensed set of size S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}8 suffices, given appropriate weights.

Typical instances include interleaved structures (“banana-shaped” clusters), where unweighted condensing cannot avoid including all points but weighted condensing, by boosting endpoints, can effect a succinct partition (Gottlieb et al., 2023).

Generalization Bounds

For empirically consistent S={(xi,yi)}i=1nX×{1,1}S = \{(x_i, y_i)\}_{i=1}^n \subset \mathcal X \times \{-1,1\}9 with S~S\tilde S \subseteq S0 and sample size S~S\tilde S \subseteq S1, the probability of error on unseen data satisfies: S~S\tilde S \subseteq S2 with probability at least S~S\tilde S \subseteq S3. A permutation-invariant reconstruction sharpens this to: S~S\tilde S \subseteq S4 These bounds closely track those for unweighted condensing, confirming that the generalization guarantees of WNN are essentially identical to the classical case (Gottlieb et al., 2023).

3. Greedy Condensing Heuristic and Algorithmic Aspects

The main practical approach is a greedy algorithm analogous to set cover:

  • Let S~S\tilde S \subseteq S5 denote the minimal distance from S~S\tilde S \subseteq S6 to any opposite-label point,
  • At each iteration, select S~S\tilde S \subseteq S7 maximizing the number of same-label points within S~S\tilde S \subseteq S8 in S~S\tilde S \subseteq S9, the set of points not yet covered,
  • Add xS~x\in\tilde S0 to xS~x\in\tilde S1 with xS~x\in\tilde S2, remove all points of the same label within this ball from xS~x\in\tilde S3,
  • Iterate until all points are covered.

Formally, each iteration solves: xS~x\in\tilde S4 subject to xS~x\in\tilde S5.

In complexity, a naive implementation needs xS~x\in\tilde S6 work for xS~x\in\tilde S7 points, but distance maintenance and spatial indexing can reduce this to xS~x\in\tilde S8 or better in practice (Gottlieb et al., 2023).

4. Bayes Consistency

Let xS~x\in\tilde S9 denote the minimal distance to an opposite-label point (outside the condensed set, set w(x)(0,)w(x) \in (0, \infty)0). Consider the (computationally hard) minimal consistent condensed set: w(x)(0,)w(x) \in (0, \infty)1 Under mild conditions—separable w(x)(0,)w(x) \in (0, \infty)2, atomless w(x)(0,)w(x) \in (0, \infty)3 distribution, piecewise-continuous Bayes function w(x)(0,)w(x) \in (0, \infty)4—the classifier w(x)(0,)w(x) \in (0, \infty)5 achieves risk converging to Bayes risk zero almost surely as w(x)(0,)w(x) \in (0, \infty)6.

Furthermore, under mild tail assumptions on the metric distribution (e.g., bounded or Gaussian), the greedy WNN condensing heuristic is also Bayes-consistent. The size of its output is at most an w(x)(0,)w(x) \in (0, \infty)7 factor larger than the optimal, so the generalization excess vanishes (Gottlieb et al., 2023).

5. Empirical Results: Compression and Accuracy

Experiments compare WNN to MSS (modified selected subset), RSS (recent selective subset), and optimal unweighted integer-programming condensing (IP). Condensed set sizes are summarized as follows:

Dataset Points MSS RSS IP (opt. NN) WNN
Circle 200 52 45 7 12
Banana 200 74 66 32 35
Iris 100 11 9 2 4

WNN substantially out-compresses classical heuristics (MSS, RSS) and approaches the performance of optimal unweighted condensing.

On the large-scale notMNIST dataset (w(x)(0,)w(x) \in (0, \infty)8 points, 10 classes, UMAP-reduced features), WNN approaches the test-set error of uncompressed 1-NN, with a compression ratio of w(x)(0,)w(x) \in (0, \infty)9 (retaining only w(x)=1w(x)=10 of samples), while MSS and RSS either compress slightly better or worse with greater accuracy degradation (Gottlieb et al., 2023).

6. Limitations, Open Problems, and Future Directions

The greedy WNN heuristic lacks a constant-factor approximation guarantee and may be improved with more sophisticated approximation strategies or by leveraging advanced geometric data structures. Computational costs remain considerable for very large datasets without specialized acceleration.

Open problems include the computational complexity and hardness of weighted condensing, improved algorithms (e.g., guaranteed w(x)=1w(x)=11-approximation), and extension to multi-class problems or broader classes of weight-dependent metric functions.

Future work involves faster nearest-neighbor search structures for weighted distances, alternative or enhanced condensing heuristics with provable properties, and integration with metric learning to adapt or optimize the base distance w(x)=1w(x)=12 in tandem with the condensing process (Gottlieb et al., 2023).

Weighted Distance Nearest-Neighbor Condensing thus strictly generalizes classical NN condensing, combines strong theoretical guarantees with dramatic reductions in storage, and presents numerous directions for continued research into scalable, high-fidelity, label-preserving data summarization.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Weighted Distance Nearest-Neighbor Condensing (WNN).