SampleClean: Fast and Reliable Analytics on Dirty Data

Sanjay Krishnan, Jiannan Wang, Michael J. Franklin, Ken Goldberg, Tim Kraska, Tova Milo, Eugene WuIEEE Data Eng. Bull 2015

Abstract

SampleClean is a framework designed to bridge the gap between high-speed approximate query processing (AQP) and the necessity of data cleaning. By cleaning only a small, strategically selected sample of a dataset, SampleClean provides query results with provable error bounds. This approach often achieves higher accuracy than querying an entire uncleaned dataset while requiring only a fraction of the computational and manual effort.

Introduction

Data scientists frequently spend the majority of their time on data cleaning—addressing missing values, duplicates, and inconsistencies. Traditional AQP techniques offer speed through sampling but assume data is perfectly clean. Conversely, standard data cleaning assumes that a dataset must be entirely cleaned to yield accurate results.

This creates a significant dilemma for massive datasets: full cleaning is prohibitively slow, yet raw samples are untrustworthy. SampleClean offers a statistically sound middle ground, allowing for accurate estimation of aggregate results (e.g., sums, averages) and reliable machine learning model training by cleaning only a tiny fraction of the data.

Methodology

SampleClean integrates data cleaning directly into the sampling process using two primary estimation techniques:

  1. Direct Estimation: A sample is drawn, cleaned, and then scaled. To handle duplication errors—where a record appearing $m$ times is $m$ times more likely to be sampled—SampleClean employs importance sampling to "down-weight" these records, maintaining an unbiased estimate.
  2. Correction: This method uses the cleaned sample to estimate the error ($\epsilon$) between the dirty and clean data. This estimated error is then subtracted from the result of a query executed over the full dirty dataset.

The framework also extends to View Cleaning, which maintains stale materialized views using a "Hash Push-down" technique, and ActiveClean, which incorporates cleaning into the Stochastic Gradient Descent (SGD) loop for machine learning.

Error reduction comparison between Direct and Correction estimation across different data corruption levels.

Key Insights

A central finding is the "Clean Sample > Dirty Population" Paradox: a query on a small, cleaned sample can be more accurate than one on the full dirty population because sampling error is boundable, whereas data bias in the full set is often unknown.

There exists a break-even point where the reduction in data bias from cleaning outweighs the error introduced by sampling. Furthermore, a trade-off exists between the two methods: Direct Estimation is robust against high error rates, while Correction is more sample-efficient when errors are relatively rare.

Key Results

The authors evaluated SampleClean using TPC-H benchmarks, Microsoft Academic Publications, and industrial video streaming logs.

  • Author Ranking: On the Microsoft Academic dataset, SampleClean achieved a correct author ranking with 95% probability after cleaning just 210 samples, and 99% probability with 326 samples.
  • Performance Speedup: For video streaming analytics, View Cleaning provided a 7.5x speedup over full incremental maintenance with less than 1% relative error.
  • Error Sensitivity: In scenarios with 50% data corruption, Direct Estimation demonstrated significantly narrower confidence intervals compared to other methods.
Probability of achieving the correct author ranking on the Microsoft Academic dataset relative to the number of cleaned samples.

Limitations and Future Work

SampleClean is highly effective for aggregates but less so for point-lookups (finding a "needle in a haystack"). Additionally, there is a risk of confirmation bias if users only clean data that supports their hypotheses. Future research may focus on APIs that limit iterative reviews to mitigate this bias and explore the theoretical limits of error bounds in various data distributions.

Summary updated

BibTeX
@article{krishnan2015sampleclean,
  author = {Sanjay Krishnan and Jiannan Wang and Michael J. Franklin and Ken Goldberg and Tim Kraska and Tova Milo and Eugene Wu},
  title = {{SampleClean: Fast and Reliable Analytics on Dirty Data}},
  journal = {IEEE Data Eng. Bull.},
  year = {2015},
}
Figure