Hide outline
Feedback

Where AI Fits In Cleaning Decisions

You are building a weekly customer sentiment KPI from a contact center survey export, 48,000 responses from the last 90 days, segmented by channel and region. You ask AI to generate cleaning code twice, once focused on keeping row count high and once focused on strict validity rules. Both pipelines run, both look reasonable, and your headline metric shifts by 14 points.

That gap is not an AI mystery. It is the compounded effect of cleaning decisions that were made implicitly, then laundered into code. AI can generate fast candidate transformations and surface suspicious patterns. You still own the methodological choices and you own the downstream failure if a stakeholder acts on a distorted KPI.

When two cleaned datasets disagree, treat the disagreement as a trace. Your job is to identify which records were dropped, which were imputed, and which definitions changed. Only then do you decide which version is defensible for the decision being made.

The decisions you must ratify

Cleaning is not one task. It is four judgment points that determine what your dataset means, and AI cannot infer the business meaning from columns alone.

Missingness mechanism is why a value is missing. Missing because not measured differs from missing because not recorded, and your imputation strategy depends on that distinction. If you let AI choose mean imputation for satisfaction_score when missingness is tied to angry callers refusing the question, you bias the KPI upward and you own that bias.

Duplicate definition is a business rule, not a string match. Two rows with the same case_id might be a true duplicate or a legitimate follow up survey. AI can propose matching keys and fuzzy logic. You must specify what counts as the same event.

Data types and units determine comparability. AI can coerce score to numeric and parse dates. You must decide whether 10 and 010 are equivalent, and whether timestamps are normalized to a single time zone.

Outlier policy is a decision about measurement versus reality. AI can flag extreme values. You decide whether to winsorize, cap, or retain, based on how the KPI is used.

Prompting as a cleaning specification

When you prompt for cleaning code, you are not asking for cleverness. You are drafting a spec that the AI will translate into executable steps.

State non negotiables as constraints. Keep all rows unless they violate explicit validity rules. Never drop records based on model inferred sentiment. Treat survey_id plus submitted_at as the primary key unless you declare an exception.

Require outputs that make decisions inspectable. Ask for a before and after row count by drop_reason, a missingness table for the fields that drive the KPI, and a reconciliation showing how many rows changed satisfaction_score due to imputation. AI can generate these reports quickly. You verify them and you attach them to the ticket so the next analyst can reproduce your path.

Sign up for free

Generate custom courses on any topic — with hands-on practice, AI guidance, and visuals built in.

Already have an account?