Data & Features

data cleaning

/ DAY-tuh KLEE-ning /

Real-world data arrives messy, like vegetables fresh from the field still caked in dirt. There are typos, blank cells, dates written five different ways, prices with stray dollar signs, the same customer entered twice under slightly different names. Data cleaning is the unglamorous but essential job of washing and tidying all this before a model ever sees it.

Concretely, cleaning includes fixing or removing obvious errors, making formats consistent (one date style, one unit of measure), deduplicating repeated rows, standardizing text ("NYC" and "New York City" mean the same place), deciding what to do about missing values, and flagging impossible entries like a person aged 200 or a negative weight. The goal is data that is accurate, consistent, and trustworthy — not necessarily perfect, but good enough that patterns in it are real rather than artifacts of sloppiness.

Why it matters: garbage in, garbage out. A model faithfully learns whatever is in the data, including the mistakes, so dirty data quietly poisons everything downstream. In practice, data scientists often spend the majority of a project on cleaning and preparation rather than on the modeling itself. It is tedious, but it is frequently where the largest gains in a model's reliability actually come from.

In a sales table you find "$1,200", "1200 USD", and "1.2k" all meaning the same amount; a city column with "Beijing", "beijing", and "Peking"; and an age of 999 used as a stand-in for unknown. Cleaning turns these into one clean number column, one canonical city name, and an honest missing-age flag.

Three spellings of one amount, one city, one fake age — cleaning makes them honest and consistent.

Cleaning is about removing errors, not inconvenient truths. Deleting rows just because they hurt your model's score, or "correcting" values toward what you hoped to find, is not cleaning — it is quietly manufacturing the result.

Also called
data cleansingdata scrubbing数据清洗数据清理資料清理