Data Quality Audit & Reporting Tool
A tidy output proves the errors are invisible, not that there are none.
- Python
- pandas
- openpyxl
Problem
Cleaning scripts are trusted because their output looks tidy: no blanks, no duplicates, no unparsed dates, job done.
But a wrongly repaired cell is well formed, in range and consistent with its neighbours. You cannot measure a cleaner's error rate by looking at its output.
Solution
A synthetic file with known defects is generated: 2,400 people, 14 columns, 15 kinds of defect injected into 22% of rows. The same dirty file goes to two cleaners, the rule engine here and a competent, ordinary twenty-line pandas cleaner. Both are scored against ground truth.
The whole architecture follows one line: every rule returns a confidence, and any suggestion below 0.85 is not applied. The row goes to a human instead.
Outcome
Cell accuracy is 0.9958 against 0.9893, but the number that matters is different: 10 silently wrong cells against 361. The naive cleaner's output looks cleaner (no blanks, no review queue) while passing 36 times as many errors in silence.
Whether the decision changes was measured too. A 4.1% pay gap was built into the population by construction: the clean population reads 3.85%, the rule engine 3.86%, the naive cleaner 3.37%. The naive cleaner understates the cost of closing that gap by 366 thousand units.
The measurement found three defects in the tool itself, none of them visible from its output: 61 correct salaries multiplied by twelve, 28 required fields silently blank, 8 malformed email addresses with no log entry at all. 134 tests.
Three rules detect a defect and still refuse to repair it.
Ambiguous date. 05/03/2024 reads two ways and both are valid. The naive
cleaner picks one with dayfirst=True and is silently wrong in 16 of 26 cases.
Title-grade contradiction. One of the two is wrong, and which one is not in the data.
Duplicate record. You can say two rows are the same person; which one survives is a decision for someone who knows which system is the source of record.
In all three the tool does not go quiet: the row joins a 271-row review queue. Counting repairs does not justify a cleaner; the repair count only says the tool was busy.
Source code
Comments are shown in the page language. Files in the repository carry both English and Turkish.
Project structure
README.md
120 lines · 10 KB
Loading…