# MissForest - nonparametric missing value imputation for mixed-type data

Random forests fill mixed-type missing data without assuming distributions

Daniel J. Stekhoven, Peter Bühlmann · arXiv · 2011-5-4

- **Problem** Most imputation methods handle only continuous or only categorical variables, so mixed data sets get split and imputed piece by piece. Methods that handle mixed types often need tuning or a parametric model that real data fit poorly.
- **Method** missForest replaces the parametric model with a random forest. It fills each variable's gaps from the other variables, repeating passes over all variables until the change between passes first increases.
- **Results** On the continuous sets, missForest cut the average NRMSE compared to KNNimpute by up to 25% in some cases.

## Why mixed-type imputation is hard

Many analysis methods need complete data, yet medical and biological measurements often leave gaps. Most imputation methods handle one variable type only, so a mixed data set is often split and imputed piece by piece. That split ignores how continuous and categorical variables relate to each other.

KNNimpute, the saturated multinomial model and MICE each rely on a tuning parameter or a specified parametric model. Choosing those settings without prior knowledge is hard, and the choice can strongly change performance. Many of these methods also assume a distribution, such as normal distributions, for the data or for subsets of variables.

MICE is the exception that handles mixed types, but it assumes a full multivariate distribution exists behind its conditional models. Real data often contain complex interactions and nonlinear structure that parametric choices capture poorly.

## Random forests as a nonparametric imputer

missForest replaces a parametric model with a random forest, a nonparametric learner that handles mixed-type data. A forest can pick up interactions and nonlinear effects without being told their form. Random forests also give out-of-bag error rates, so an imputation error can be estimated without a test set.

The forest's built-in routine for missing values trains on mean imputed data and weights observed values by proximities, but it still needs a complete response. missForest therefore trains a forest only on the observed entries of each variable and predicts its gaps from the other variables. Because this is repeated over all variables, each round of predictions feeds the next round of fits.

## The iteration step by step

missForest starts from an initial guess, such as mean imputation. It then sorts the variables by how many values are missing, from fewest to most. For each variable, a random forest is fitted with the observed entries as the response and the other variables as predictors. The fitted forest predicts the missing entries from the other variables, and the imputed matrix is updated with those predictions.

After one full pass over all variables, the loop checks a stopping criterion. The criterion is met when the change between the new and previous imputed matrices first increases, checked for both variable types where both are present. For continuous variables the change is \\(\\Delta\_N\\), the sum over the continuous columns of the squared difference between new and old imputed values, divided by the sum of squared new imputed values over the same columns.

For categorical variables \\(\\Delta\_F\\) counts the entries that changed between passes and divides by the number of categorical missing values.

## How the errors were measured

Continuous error is the normalised root mean squared error, NRMSE, computed over the missing entries. It takes the square root of the mean squared gap between true and imputed values and divides by the variance of the true values. Categorical error is the proportion of falsely classified entries, PFC, over the categorical missing values. In both cases values near 0 are good and values near 1 are bad.

Each experiment ran 50 simulations with 10%, 20% or 30% of values removed completely at random. Paired Wilcoxon tests compared each competitor's errors with missForest's errors across the runs. Each forest's out-of-bag estimate was recorded and averaged over variables of the same type. The KNNimpute baseline scaled every variable to unit standard deviation and centred it, then transformed back before computing error.

## Continuous data: gains over KNNimpute and MissPALasso

On the continuous sets, missForest cut the average NRMSE compared to KNNimpute by up to 25% in some cases. On the musk molecule data the reduction exceeded 50%. The authors tie these gains to data with complex interactions and nonlinear relations.

MissPALasso was slightly better than missForest on the gene expression data. It could not run on the Insulin data, because the high dimension made computation infeasible. missForest typically reached its stopping criterion after about 5 iterations on continuous data. Its runtime was about 10 times that of cross-validated KNNimpute.

## Categorical and mixed-type results

On the categorical sets, missForest had lower PFC than both MICE and cross-validated KNNimpute in every comparison. On the SPECT data its PFC was up to 60% lower than MICE's, while on the other sets the gap was around 10 to 20%. The amount of missing values changed error only a little, since all methods except MICE on SPECT rose by 1 to 2%.

The authors point out that MICE is not primarily built for imputation accuracy but for assessing uncertainty.

On the mixed-type sets missForest was better than the other methods, reducing error in many cases by more than 50%. The exception is GFOP, where KNNimpute had a slightly smaller NRMSE but made about twice the categorical error of missForest. MICE on the Children's Hospital data is harder to read, because its variables are ill-distributed and nearly dependent.

To make MICE run, nearly dependent variables were removed after each missingness step, an average of 7 variables per simulation, so no significance statements are made for it.

## Whether the OOB estimates track the true error

Each simulation run gives an OOB estimate that can be compared with the true imputation error. On the Isoprenoid and Musk data the two differ by only a few percent. On the Parkinson's data the estimates vary more, though on average they are comparably good.

On the categorical sets the estimates tend to underestimate the true error as the share of missing values grows. The authors say the absolute size of the error plays a minor role in how accurate the estimates are, comparing SPECT with Promoter. The authors summarise that the OOB estimate deviates proportionally by no more than 10 to 15% on average.

## Runtime and tuning cost

KNNimpute was by far the fastest method in the runtime comparison, and missForest ran considerably faster than MICE and MissPALasso. On Isoprenoid the average runtime was 0.8 s for KNNimpute, 170 s for MissPALasso and 5.8 s for missForest. On the Insulin data missForest took 6200 s on average.

Two settings control the cost: the number of trees and the number of variables tried at each split, mtry. The comparisons used 100 trees, and fewer trees barely changed error while cutting time roughly linearly. The default mtry is the floor of the square root of p, which gives 4 for the GFOP data. With mtry equal to 1 the forest is no longer a random forest, and error rose much higher, especially with few trees.

## Limits of the evidence

The MICE comparison on the Children's Hospital data carries no significance statements and relies on removing variables. MissPALasso has no Insulin result, so the continuous comparison is incomplete for the highest-dimensional set. The Insulin data had 10 simulations instead of 50. The simulations removed values completely at random only, so other missingness mechanisms were not tested.

On categorical data the OOB estimate can understate the error as missingness grows. The Insulin imputation took about 2 hours on average on a desktop computer.

## Paper info

- **Authors**: Daniel J. Stekhoven, Peter Bühlmann
- **Venue**: arXiv · Preprint
- **First published**: 2011-5-4
- **Added**: 2026-11-11
- **Updated**: 2011-9-27
- **Version**: v2
- **arXiv**: 1105.0828
- **DOI**: 10.1093/bioinformatics/btr597
- **Category**: stat.AP · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1105.0828v2) · [PDF ↗](https://arxiv.org/pdf/1105.0828v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Daniel J. Stekhoven, Peter Bühlmann (2011). MissForest - nonparametric missing value imputation for mixed-type data. arXiv:1105.0828v2. https://doi.org/10.1093/bioinformatics/btr597

**BibTeX**

```
@article{stekhoven2011missforest,
  title = {{MissForest - nonparametric missing value imputation for mixed-type data}},
  author = {Daniel J. Stekhoven and Peter Bühlmann},
  year = {2011},
  eprint = {1105.0828},
  archivePrefix = {arXiv},
  doi = {10.1093/bioinformatics/btr597},
  url = {https://arxiv.org/abs/1105.0828v2}
}
```

## Other paper commentary

- [Federated Machine Learning: Concept and Applications](https://refivu.com/en/papers/d845d53f-b001-4e9b-be12-12d49f74b856-federated-machine-learning-concept-and-applications.md)
- [A Comprehensive Survey on Transfer Learning](https://refivu.com/en/papers/c3ef16ed-6b27-4ef6-a0f1-b20616ba3e47-a-comprehensive-survey-on-transfer-learning.md)
- [Deep Learning with Differential Privacy](https://refivu.com/en/papers/a0a5e243-9f30-4599-aa16-17cc0c7b4ba8-deep-learning-with-differential-privacy.md)
- ["Why Should I Trust You?": Explaining the Predictions of Any Classifier](https://refivu.com/en/papers/856ed702-7f55-4af3-8fa5-45538051a0a4-why-should-i-trust-you-explaining-the-predictions.md)
- [A Survey on Bias and Fairness in Machine Learning](https://refivu.com/en/papers/74d1cfa5-92d6-42d0-bf31-348c21768dc6-a-survey-on-bias-and-fairness-in-machine.md)
- [Artificial Intelligence: the global landscape of ethics guidelines](https://refivu.com/en/papers/d19d6be2-ce31-43ea-b84d-0b4bbe03543f-artificial-intelligence-the-global-landscape-of-ethics.md)
- [Deformable DETR: Deformable Transformers for End-to-End Object Detection](https://refivu.com/en/papers/e0311cd6-f252-409d-a37d-7b236622ec8e-deformable-detr-deformable-transformers-for-end-to-end.md)
- [BERTScore: Evaluating Text Generation with BERT](https://refivu.com/en/papers/30f8b3be-d1a1-4c44-9203-702fc98d0cc9-bertscore-evaluating-text-generation-with-bert.md)
- [Swin-Unet: Unet-like Pure Transformer for Medical Image Segmentation](https://refivu.com/en/papers/178a13b8-5d0e-4448-a1cb-759db558ade3-swin-unet-unet-like-pure-transformer-for-medical.md)
- [How transferable are features in deep neural networks?](https://refivu.com/en/papers/cb0b30a7-565d-41f8-bd71-41713c953bea-how-transferable-are-features-in-deep-neural-networks.md)
- [HuggingFace's Transformers: State-of-the-art Natural Language Processing](https://refivu.com/en/papers/226edb36-2edb-4a96-aca3-9909969cdf23-huggingface-s-transformers-state-of-the-art-natural.md)
- [The Mythos of Model Interpretability](https://refivu.com/en/papers/28c70275-bdc3-4d2e-8c3b-711d370f197b-the-mythos-of-model-interpretability.md)

## Terms in this paper

- [random forest](https://refivu.com/en/terms/e69b7b54f2ea-random-forest)
- [paired Wilcoxon test](https://refivu.com/en/terms/8880288ef18d-paired-wilcoxon-test)
- [mean imputation](https://refivu.com/en/terms/2ad66ce3f84b-mean-imputation)
- [NRMSE](https://refivu.com/en/terms/6008d6412372-nrmse)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/ab5b3748-ade4-4bb9-b016-975b4f82baee-missforest-nonparametric-missing-value-imputation-for-mixed)
