1. Home
  2. Explore
  3. Computer Science
  4. Classifying and Fixing Dirty Data

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Classifying and Fixing Dirty Data

Between the Spreadsheets: Classifying and Fixing Dirty Data for Data Science

🧠 Introduction to Dirty Data

Dirty data refers to any data that is inaccurate, incomplete, inconsistent, or otherwise flawed. It is a pervasive problem in every industry and can arise from human error, system migrations, lack of standardization, or simply the passage of time. Recognizing and fixing dirty data is a critical β€” but often overlooked β€” step in the data science pipeline.

The speaker, Susan Walsh (founder and managing director of Classification Guru), brings a unique perspective: she fell into data work after a career in sales and retail, and discovered a passion for classifying and normalizing messy datasets. Her experience spans industries, languages, and millions of rows of data. She emphasizes that cleaning data is not glamorous but is essential β€” and that it can be done effectively using simple techniques and a systematic approach.

πŸ” What Is Dirty Data? (Common Types)

Dirty data takes many forms. The following list covers the most frequently encountered categories:

  • Misspelt words – in descriptions, names, product codes, or any text field. Example: "reciept" instead of "receipt."

  • Incorrect descriptions – accidentally cut-and-paste entries that don’t match the actual item (e.g., a purchase order describing a "laptop" where the item is actually a printer).

  • Missing codes – product codes, supplier IDs, or other identifiers that are blank or incomplete.

  • Data in the wrong columns – common with addresses: zip codes in the city field, states in the zip code field, etc. This is particularly messy to untangle.

  • Inconsistent units of measure – miles vs. kilometers, liters vs. gallons, different spellings (e.g., "liter" vs. "litre").

  • Currency errors – misapplied exchange rates or wrong currency symbols (e.g., calculating 500 for taxis instead of 50).

  • Formatting issues – especially with dates. Different people use different formats: DD/MM/YYYY, MM/DD/YYYY, DD-MM-YY, YYYY.MM.DD, etc. The ISO standard (YYYY-MM-DD) exists but is rarely followed universally.

  • Duplicates and near duplicates – exact copies of records, or variations like "Robert Smith," "Bob Smith," and "Rob Smith" all referring to the same person. These waste storage, create confusion, and skew analyses.

Misclassification is another major category. Example: classifying LinkedIn (a social network for professionals) as a "restaurant" because the description contained the word "restaurant." This happens when the classifier looks at only one or two columns instead of the full context of the row. Another example: Speed Courier classified as "equipment maintenance" or Tinder Corporation (which is actually an IT cabling company in the UK) incorrectly assumed to be the dating app.

Key takeaway: Never assume you know what a value means β€” always use the context of the full dataset (supplier name + description + other columns) and double-check with external sources like Google.

⚠️ Consequences of Dirty Data

Dirty data is not just a nuisance β€” it has real, measurable impacts on organizations.

  • Wasted money and time – fixing dirty data after the fact is expensive. A small upfront investment in cleaning can save huge costs later.

  • Costly rectification – dirty data that goes unnoticed through a project or system implementation can require expensive rework or even project abandonment.

  • Affects decision-making – executives rely on data for budgeting, headcount, strategy, and bonuses. Flawed data leads to flawed decisions.

  • Poor model performance – machine learning models trained on dirty training data ("garbage in, garbage out") will produce unreliable predictions.

  • Legal and privacy risks – incorrect personal data (names, addresses, etc.) may violate privacy laws (e.g., GDPR) and expose the organization to legal action.

  • Reputational damage – harder to recover from than a fine; lost trust can be permanent.

  • Missed opportunities for profit – clean data enables accurate forecasting, better customer targeting, optimized supply chains, and stronger negotiations.

Example: A company with unnormalized supplier names may see "PwC," "PWC," "PricewaterhouseCoopers" as separate entries. After normalization, the true spend with PwC becomes apparent β€” much higher than originally thought, enabling better vendor management.

The old adage holds: garbage in, garbage out. Cleaning data at the source is far more efficient than trying to fix everything downstream.

πŸ› οΈ Ensuring Data Accuracy: The COAT Framework

There is no magic button or single software that will solve all dirty data problems. Manual review and organizational buy-in are essential. The following steps form a philosophy called COAT β€” a memorable acronym for data quality.

C – Consistent

  • Use consistent standards, terms, classifications, and processes across the entire organization.

  • Define what a "customer" means (internal vs. external), agree on date formats, units of measure, naming conventions, and so on.

  • Consistency minimizes variation and makes data easier to aggregate and compare.

O – Organized

  • Categorize data by departments, regions, divisions, or spend categories (like organizing a closet by type and color).

  • When data is well-organized, retrieving information (e.g., "How much did we sell in the UK last year?") takes minutes instead of days.

  • Use a clear taxonomy to group like items together.

A – Accurate

  • Strive for correctness at the most basic level: correct names, amounts, dates, codes.

  • Accuracy is relative but must be defined and measured. Spot checks and validation rules help maintain it.

T – Trustworthy

  • When data is consistent, organized, and accurate, stakeholders can trust it.

  • Trust means that decisions based on the data will be accepted without constant second-guessing. It also encourages adoption of analytics tools.

Blockquote: "Your data needs its coat on." Just as you wouldn’t go into sub-zero temperatures without proper protection, you shouldn’t let data go unprotected. COAT ensures data is protected from the elements of chaos.

πŸ“Š Practical Tips for Spot-Checking and Fixing Data in Excel

Even though Excel is not the most powerful tool for large datasets, it is widely available. The following techniques can be adapted to any environment (Power BI, Tableau, Python, etc.).

Using Pivot Tables for Aggregated Review

  1. Create a pivot table with key fields (e.g., normalized supplier and category).

  2. Switch to tabular form and remove subtotals to see a clean list.

  3. Scroll through the aggregated list looking for anomalies. Example: Dell (an IT company) classified as "Courier" β€” this error occurs because the invoice included a delivery charge line item, and a keyword-based classifier flagged "delivery" without considering the context of the rest of the row.

  4. Fix errors in the raw data, then refresh the pivot table.

Side-by-Side Windows

  • Use New Window (View β†’ New Window) and Arrange All (Vertical) to see the pivot table on one side and the raw data on the other.

  • Methodically go through the aggregated list, identify incorrect entries, and correct them directly in the raw data tab.

  • Refresh the pivot table to see the updated aggregated view.

Scaling Up

For large datasets:

  • Chop the data by logical groupings (country, division, department, product group) and review each chunk separately.

  • Use keyword searches (e.g., for supplier names, descriptions) to flag potential misclassifications.

  • Check numerical ranges β€” if you know you sold only 1,000 units in a year but a record shows 10,000, that’s a red flag.

  • Extra layers of data (e.g., supplier + description) help catch context-dependent errors.

More Advanced Tools

The speaker uses Omniscope, a tool that combines visualization with live editable tables and can handle millions of rows. However, the principle remains the same regardless of tool: aggregate, spot-check, fix, verify.

πŸ“ˆ The Dirty Data Maturity Model

This model was created to help data professionals communicate the state of their data quality to non-technical stakeholders. It uses a simple, visual analogy β€” like turning underwear inside out for one more day.

Stage

Description

Dirty Data

You know the data has problems but keep putting off fixing it. Eventually a crisis forces action.

D-Class Data

Some rules and procedures exist, but they are unstructured and inconsistently applied. Hope is the main strategy.

Distributed Data

Data is somewhat organized, tools are in use, and some analytics are performed. Still messy but manageable.

Disorder Data

The right tools exist but are not used regularly. Cleaning and checking are not prioritized.

Dirt-Free Data

The pinnacle. Well-trained staff, proper tools, automation, regular spot-checking, and maintenance. Errors are minimal and quickly fixed.

Key takeaway: Getting to dirt-free data requires ongoing effort. Once there, you must work hard to stay there. Share this model with your organization to start conversations about where you are and where you need to be.

🀝 Getting the Organization Involved

Data quality is everyone’s responsibility, not just the data team's. People who input data (sales, customer service, procurement) often don’t realize the downstream consequences of their mistakes.

  • Train users on the impact of incorrect entries.

  • Show them the consequences β€” e.g., a wrong code leads to a failed delivery or a misdirected marketing campaign.

  • Agree on common standards for terms, dates, units, classifications. Document these in a glossary or taxonomy.

  • Make it human β€” connect the data work to real-world outcomes.

  • Spot-check regularly β€” data that was correct last month may be corrupted this month because of accidental deletion or overwrite.

❓ Key Q&A Insights

  • Date formatting: Choose one format and enforce it organization-wide. If all dates are the same, converting to another format later is easy. If they are mixed, it’s a nightmare.

  • Ensuring correct field selection: For internal users, training and accountability (e.g., league tables with prizes for accuracy) can help. For the general public, it’s much harder β€” expect errors.

  • Normalization: Always normalize before cleaning. Grouping multiple versions of the same entity (e.g., "IBM," "I.B.M," "IBM Inc.") reduces the number of distinct items you need to classify. Normalization applies to supplier names, product names, product groups β€” anything that has variations.

  • Context matters: Natural language understanding can help, but it works better for some domains (hardware, simple products) than for complex procurement descriptions (e.g., "taxi from hotel to restaurant" requires parsing multiple entities).

  • Testing tools: Most visualization and data cleaning tools offer free trials. The best tool is the one that meets your objectives and fits your workflow.

✨ Final Summary

  • No shortcuts β€” manual review is inevitable. You must know your data.

  • Maintain your data β€” cleaning is not a one-time event; it requires continuous spot-checking and upkeep.

  • Agree on standards β€” consistency prevents future messes.

  • Get the whole organization involved β€” data quality is a shared responsibility.

  • Use the COAT framework β€” Consistent, Organized, Accurate, Trustworthy β€” to remember what good data looks like.

  • Communicate with visual models β€” the Dirty Data Maturity Model helps stakeholders understand the problem and the path to a solution.

Dirty data is a universal challenge, but with the right mindset, simple tools, and organizational support, it can be tamed. The result: better decisions, less wasted time, and increased confidence in the data that drives the business.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent