# Missing Values in a Model

Most scikit-learn models stop with an error when a feature holds NaN, and dropping those rows throws away examples and leaves a new pet with a blank unscorable, so SimpleImputer fills each blank with a value learned from the training data (the median for numbers, the most frequent value for categories), and add_indicator=True keeps a column saying which values were missing.

![Cheat sheet: Missing Values in a Model](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/bb4b65568dee4f618ada7866ccffe2e3.webp)

- Category: Machine Learning
- Level: Journeyman
- Tags: ai, Imputation, Missing Indicator, Missing Value, NaN (python), python, SimpleImputer
- Author: Gregor Dzierzon
- Updated: November 23, 2026

Source: https://www.ask-codey.com/cheat-sheets/ml-missing-values-in-a-model-cheat-sheet
