Papers
Topics
Authors
Recent
Search
2000 character limit reached

CPClean: Certainty-Driven Data Cleaning

Updated 13 April 2026
  • CPClean is a data cleaning methodology that applies certain prediction semantics to improve classification on incomplete datasets.
  • It leverages polynomial-time Q1 and Q2 computations for K-NN, efficiently identifying ambiguous examples for targeted intervention.
  • Empirical evaluations show CPClean can close up to 66% of the accuracy gap with a limited cleaning budget compared to standard methods.

CPClean is a data cleaning methodology for machine learning grounded in the theory of Certain Predictions (CP), which extends database “certain answer” semantics to supervised classification on incomplete datasets. It aims to identify and prioritize ambiguous training examples whose disambiguation, typically via human intervention, will most efficiently confer stability and accuracy to downstream predictions. The approach is tractable for k-nearest-neighbor (K-NN) classifiers: although the possible completions of an incomplete table are combinatorially large, CPClean offers polynomial-time (and often linear-time) algorithms for determining prediction certainties and supporting cleaning decisions, thereby enabling targeted, cost-effective manual cleaning for robust model performance (Karlaš et al., 2020).

1. Formal Basis: Certain Prediction (CP) Framework

CPClean operates on an incomplete training set, modeled as a Codd table

D={(Ci,yi)i=1,,N},D = \{ (C_i, y_i) \mid i = 1,\ldots,N \},

where each CiXC_i \subseteq \mathcal{X} is a finite candidate set of possible feature-vectors for the iith example and yiYy_i \in \mathcal{Y} is the (known) label. The set of possible worlds represented is

ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},

with ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|. For a fixed learning algorithm L\mathcal{L}, each DD' yields a classifier hD=L(D)h_{D'} = \mathcal{L}(D').

A test point tt is certainly predicted as label CiXC_i \subseteq \mathcal{X}0 if every possible CiXC_i \subseteq \mathcal{X}1 yields CiXC_i \subseteq \mathcal{X}2. The CP “checking” query (Q1) asks whether this is true, whereas the “counting” query (Q2) computes the number of worlds in which CiXC_i \subseteq \mathcal{X}3 receives label CiXC_i \subseteq \mathcal{X}4: CiXC_i \subseteq \mathcal{X}5

CiXC_i \subseteq \mathcal{X}6

These primitives reveal prediction ambiguity stemming from data incompleteness.

2. Efficient Certain Prediction Computation for K-NN

For K-NN classifiers, both Q1 and Q2 admit polynomial-time solutions despite the size of CiXC_i \subseteq \mathcal{X}7.

  • Compute similarities CiXC_i \subseteq \mathcal{X}8 for all candidates CiXC_i \subseteq \mathcal{X}9.
  • Define for each ii0 an ii1-vector ii2, whose ii3th entry counts the number of candidates in ii4 no more similar to ii5 than ii6.
  • Boundary sets ii7 characterize the set of worlds in which ii8 is a boundary ii9th neighbor of yiYy_i \in \mathcal{Y}0; their size is computable via

yiYy_i \in \mathcal{Y}1

  • Label-tally configurations yiYy_i \in \mathcal{Y}2 and the SupportyiYy_i \in \mathcal{Y}3 quantity (via dynamic programming) yield the contributions per yiYy_i \in \mathcal{Y}4-neighbor set.
  • For Q2, these components are aggregated to count the total number of worlds in which the label tally favors yiYy_i \in \mathcal{Y}5. The complexity is yiYy_i \in \mathcal{Y}6 for small yiYy_i \in \mathcal{Y}7.

For binary classification, Q1 can be solved even more rapidly: for label yiYy_i \in \mathcal{Y}8, construct the yiYy_i \in \mathcal{Y}9‐extreme world ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},0 by maximally or minimally favoring that label via candidate selection; Q1 is true iff ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},1 predicts ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},2 for ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},3.

3. CPClean Algorithmic Workflow

The CPClean process consists of iterative, information-theoretic selection of training points to clean:

  1. Initialization: Begin with an incomplete training set ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},4 and a clean validation set ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},5.
  2. Cleaning model: At each step, select an index ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},6 whose ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},7 will be replaced (by an oracle) with the true ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},8 (singleton), at unit cost. The goal is to minimize the number of such interventions ID={D={(xi,yi)}i=1N:xiCi for all i},\mathcal{I}_D = \{ D' = \{(x_i, y_i)\}_{i=1}^N : x_i \in C_i \text{ for all } i \},9 until all ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|0 are certainly predicted (Q1 is true for all).
  3. Greedy selection rule: At each round, choose ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|1 to minimize the expected conditional entropy,

ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|2

where ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|3.

  1. Oracle cleaning: For each ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|4, the expected new entropy is averaged over possible ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|5.
  2. Termination: When all validation points are certainly predicted, the process halts. Any world completion agrees with the true world on ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|6.
  3. Guarantee: The greedy process obtains a ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|7 approximation (up to ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|8 factor) to the maximal possible information gain by any cleaning policy.

4. Illustrative Example

For ID=i=1NCi|\mathcal{I}_D| = \prod_{i=1}^N |C_i|9, L\mathcal{L}0, binary labels:

  • L\mathcal{L}1, L\mathcal{L}2; L\mathcal{L}3, L\mathcal{L}4.
  • Four possible worlds: L\mathcal{L}5, L\mathcal{L}6, L\mathcal{L}7, L\mathcal{L}8.
  • Q2 counts the number of worlds where test point’s nearest neighbor has L\mathcal{L}9 (using DD'0-products), and similarly for DD'1.
  • At each cleaning step, CPClean evaluates—via Q2—the expected entropy decrease by selecting DD'2 vs DD'3 (averaging over possible DD'4 replacements), and picks the tuple whose cleaning most reduces ambiguity on validation.

This exemplifies CPClean’s capacity for targeted, uncertainty-driven tuple disambiguation.

5. Empirical Evaluation and Comparative Performance

CPClean was evaluated on datasets including BabyProduct (DD'5, 11.8% real missing), Supreme, Bank, and Puma (each DD'6–DD'7, with synthetic 20% missing-not-at-random injection), using DD'8 and Euclidean distance in K-NN, with 1,000 validation and test examples per dataset.

Cleaning baselines included:

  • Ground truth (full manual cleaning),
  • Default imputation (mean/mode),
  • HoloClean (probabilistic cleaning),
  • BoostClean (best heuristic by validation),
  • RandomClean.

CPClean consistently outperformed baseline methods. On average, with a fixed 20% cleaning budget, CPClean closed 66% of the accuracy gap (from default-imputed to fully-cleaned) compared to DD'930% for RandomClean. In many cases, CPClean achieved 100% of the possible gap closure with cleaning performed on only 15–65% of tuples. HoloClean sometimes degraded classifier accuracy (gap closed negative). Beyond 1,000 validation examples, additional validation size had negligible effect on CPClean’s stability. CPClean’s information-theoretic surrogate performed robustly across datasets (Karlaš et al., 2020).

6. Practical Considerations and Broader Impact

CPClean supports both incomplete-data scenarios arising from natural attribute-missingness and those with multiple candidate repair values per tuple. The algorithm steers manual effort to “high influence” cases—tuples whose certainty would most impact the predictive stability on validation or test sets. Its framework is model-agnostic at the conceptual level, but the current tractable implementation assumes K-NN with modest hD=L(D)h_{D'} = \mathcal{L}(D')0 and hD=L(D)h_{D'} = \mathcal{L}(D')1.

A plausible implication is that, for other learning algorithms where Q1/Q2-like primitives can be made tractable, analogous versions of CPClean could be developed. The approach is theoretically guaranteed to be near-optimal in its class and empirically demonstrates significant efficiency gains in data cleaning for machine learning pipelines.

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 CPClean.