CPClean: Certainty-Driven Data Cleaning
- 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
where each is a finite candidate set of possible feature-vectors for the th example and is the (known) label. The set of possible worlds represented is
with . For a fixed learning algorithm , each yields a classifier .
A test point is certainly predicted as label 0 if every possible 1 yields 2. The CP “checking” query (Q1) asks whether this is true, whereas the “counting” query (Q2) computes the number of worlds in which 3 receives label 4: 5
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 7.
- Compute similarities 8 for all candidates 9.
- Define for each 0 an 1-vector 2, whose 3th entry counts the number of candidates in 4 no more similar to 5 than 6.
- Boundary sets 7 characterize the set of worlds in which 8 is a boundary 9th neighbor of 0; their size is computable via
1
- Label-tally configurations 2 and the Support3 quantity (via dynamic programming) yield the contributions per 4-neighbor set.
- For Q2, these components are aggregated to count the total number of worlds in which the label tally favors 5. The complexity is 6 for small 7.
For binary classification, Q1 can be solved even more rapidly: for label 8, construct the 9‐extreme world 0 by maximally or minimally favoring that label via candidate selection; Q1 is true iff 1 predicts 2 for 3.
3. CPClean Algorithmic Workflow
The CPClean process consists of iterative, information-theoretic selection of training points to clean:
- Initialization: Begin with an incomplete training set 4 and a clean validation set 5.
- Cleaning model: At each step, select an index 6 whose 7 will be replaced (by an oracle) with the true 8 (singleton), at unit cost. The goal is to minimize the number of such interventions 9 until all 0 are certainly predicted (Q1 is true for all).
- Greedy selection rule: At each round, choose 1 to minimize the expected conditional entropy,
2
where 3.
- Oracle cleaning: For each 4, the expected new entropy is averaged over possible 5.
- Termination: When all validation points are certainly predicted, the process halts. Any world completion agrees with the true world on 6.
- Guarantee: The greedy process obtains a 7 approximation (up to 8 factor) to the maximal possible information gain by any cleaning policy.
4. Illustrative Example
For 9, 0, binary labels:
- 1, 2; 3, 4.
- Four possible worlds: 5, 6, 7, 8.
- Q2 counts the number of worlds where test point’s nearest neighbor has 9 (using 0-products), and similarly for 1.
- At each cleaning step, CPClean evaluates—via Q2—the expected entropy decrease by selecting 2 vs 3 (averaging over possible 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 (5, 11.8% real missing), Supreme, Bank, and Puma (each 6–7, with synthetic 20% missing-not-at-random injection), using 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 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 0 and 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.