Art of DS

Appearance

Palette
Theme
Unlock $20 one time
Sign in, or create an account

Sign in to Art of DSCreate your Art of DS account

We email you a link and a six-digit code. Either one signs you in; there is no password.Enter your email. We send a link and a six-digit code to confirm it — no password to remember. The account is free.

  • You come back to this page, right where you were.
  • Already have an account? The same email simply signs you in.

By continuing you accept the Terms and the Privacy policy.

Your account

Free accountLifetime access

Gaps and odd values, drop or fill?

Five ways to handle missing values side by side, the pairs people confuse, and one run where dropping rows gets the mean wrong and the slope right.

prints on 2 A4 pagesfrom 4 pages and 1 cataloguefree to read · PDF with a free accountUpdated 24 Oct 2026

Download PDF

The PDF and the Print button ask you to sign in; a free account is enough. Reading and Test yourself are open to everyone.

Side by side

The first columns are the Missing-data methods catalogue’s; the rest come from each page.

Say what each one answers, what it cannot see and when to reach for it, then reveal its row.

Method Under MAR Spread and relationships Uncertainty Reach for it when Trap
Complete case mean wrong, slope right kept honest, on fewer rows the gaps are random and rows are plentiful Assuming MCAR because it is convenient.
Mean imputation mean wrong, slope shrunk shrunk understated a quick baseline; never a feature you model Mean imputation on a modelling feature.
Regression imputation mean and slope recovered relationships overstated understated other columns explain the gaps, and only point estimates matter Trusting an interval or a p-value computed after single imputation.
Regression + residuals mean and slope recovered kept understated other columns explain the gaps, and spread matters too Fitting the imputer before the split.
Multiple imputation as its imputer allows kept carried through you report an interval or a p-value after filling Expecting a better algorithm to solve MNAR.

A formula is printed only when it is shorter than the words; the others are said in words, and each page has its formula.

Easy to confuse

The “what is the difference between…” questions, in two lines each.

  • MAR vs MNAR

    MAR, the gaps depend on columns you have; MNAR, on the missing values themselves.

    MAR, impute from those columns; MNAR, no method fixes it, so show how far the answer moves.

  • Filled value vs Missing indicator

    Filling makes a gap look observed; an indicator column keeps the fact that it was blank.

    Fill and add the indicator; that a value was not recorded is often a signal.

  • Outlier vs Error

    An outlier is unusual; an error is wrong. A test finds the first, only the data's origin proves the second.

    Delete only what you can show is wrong; keep the rest and use a robust method.

  • Fitted on all data vs Fitted in the fold

    An imputer or scaler fitted on all the data has seen the test rows; one fitted in the fold has not.

    Always in the fold, inside the pipeline that is cross-validated.

One real run

Each method under each mechanism, 35 to 40% of y deleted, against the truth on top.

Method MCAR slope MAR mean MAR slope MAR corr. MNAR mean
truth 2.00 1.00 2.00 0.89 1.00
complete case 1.99 0.13 2.00 0.86 0.04
mean imputation 1.30 0.13 0.88 0.57 0.04
regression imputation 1.99 1.01 2.00 0.93 0.76
+ resampled residuals 1.99 1.01 2.00 0.89 0.76

“Mean imputation is not a mild approximation — it is a transformation of the data.”

“Under MAR, which estimate you wanted decides whether you have a problem.”

“Under MNAR nothing works.”

The run and these lines are the worked example on Missing data, as it printed: each method under each mechanism, against the truth

Which one?

  1. What is wrong with the column?

  2. Where are the imputer and scaler fitted?

Each answer is from its page’s “Why & when”.

All 21 traps on these pages

Each is the opening line of a pitfall; its page says why.

Missing data

  • Assuming MCAR because it is convenient.
  • Mean imputation on a modelling feature.
  • Fitting the imputer before the split.
  • Dropping the missingness indicator
  • Trusting an interval or a p-value computed after single imputation.
  • Expecting a better algorithm to solve MNAR.

Outliers

  • Using |Z| > 3 on a small sample.
  • Running a single-outlier test repeatedly.
  • Testing for outliers without checking the distribution.
  • Deleting on the strength of a test alone.
  • Removing outliers from the test set.
  • Treating robustness as free.

Feature engineering

  • Fitting the transform on all the data.
  • Leaking the target.
  • Training/serving skew.
  • Ordinal encoding of unordered categories.

Data leakage

  • Believing a pipeline is enough.
  • Random splits on grouped data.
  • Deduplicating after splitting
  • Tuning on the test set.
  • Resampling before the split.

Have a promo code?

A code that takes 100% off unlocks everything at once. A smaller one takes its share off the price in the payment window: enter the same code there.

Write to support

A question, a problem with access, a refund? Write to us and we answer by email.

What is it about?

Your address is used only to answer you.

Message sent

Thank you. We will reply to the address you gave, by email.

Or write to us directly

support@artofds.com

Message sent Thank you. We will reply to the address you gave, by email.

Check the email address: we need it to reply.

That is our own address. Enter yours, so the reply reaches you.

This address cannot receive email. Check it for a typo.

Write a little more: at least 10 characters.

Too many messages in a short time. Try again in a few minutes.

The message could not be sent. Please write to us directly: support@artofds.com