Course contentsShow
← Machine Learning and Deep Learning
Lesson 431 of 3,53810. Feature EngineeringFree lesson

Deletion Strategies: Listwise and Pairwise

When and how to remove rows or columns with missing data, understanding the trade-offs and impact on sample size.

Deletion Strategies: Listwise and Pairwise

You'll learn: The two fundamental approaches to removing missing data from your dataset and when each makes sense.

What Is Data Deletion?

When you encounter missing data, the simplest approach is to just remove it. But how you remove it matters enormously. There are two main strategies: listwise deletion (also called "complete case analysis") and pairwise deletion.

Listwise Deletion

Listwise deletion removes an entire row if any value in that row is missing. Think of it like quality control: if one measurement in a test is invalid, you discard the whole test result.

Example: If your dataset has 1000 rows and 50 columns, and a single row is missing just one value in one column, that entire row gets deleted.

Trade-off: You lose potentially valid data in the other 49 columns. If many rows have at least one missing value, your sample size can shrink dramatically.

Pairwise Deletion

Pairwise deletion only removes missing values when calculating specific relationships between features. It's like using all available information for each individual calculation.

Example: When computing correlation between Feature A and Feature B, you only exclude rows where either A or B is missing—not rows where unrelated Feature C is missing.

Trade-off: Different calculations use different subsets of data, which can lead to inconsistent sample sizes and sometimes mathematically impossible results.

When to Use Each

  • Listwise: When missing data is rare (< 5%) and truly random (MCAR). Simpler and safer for most machine learning models.
  • Pairwise: When analyzing relationships between specific pairs of features and you can't afford to lose much data—though rarely used in ML pipelines.

Key Takeaway: Listwise deletion is the most common strategy in ML because it keeps your dataset consistent, but it can dramatically reduce your sample size if missingness is widespread—understanding this trade-off helps you decide whether to delete or impute.