Dataset cleaning is the unglamorous work that determines whether everything built afterward holds up. It happens before labeling, before modeling, before anything interesting.

Start with duplicates

Duplicate records inflate counts, skew statistics, and waste labeling effort. Deduplicate on a meaningful key, not just an exact row match, since the same record often appears with small formatting differences.

Normalize formats

Dates, phone numbers, currency, and units should follow one format throughout the dataset. Inconsistent formatting is the single most common reason a dataset breaks when imported into a new tool.

Handle missing values deliberately

Decide, field by field, whether a missing value should be dropped, filled with a default, or flagged. Silently leaving blanks creates ambiguity for every downstream consumer.

Validate against a schema

Define the expected type and range for each field, then run every record against it. This catches the outliers a human reviewer would miss... a price field with a negative number, a date field set decades in the future.

Document what you removed

Keep a record of what was dropped and why. If three percent of your source data got cut for being unverifiable, anyone using the dataset later should know that.

Cleaning is not a one-time pass. Treat it as a checklist you run every time the dataset is updated, not a step you do once and forget.

← Back to all guides