Web Analytics

missForest

⭐ 109 stars German by stekhoven

🌐 Sprache

missForest

CRAN Status CRAN RStudio Mirror Downloads CRAN RStudio Mirror Downloads R-CMD-Check test-coverage License: GPL (≥ 2)-blue.svg)

missForest ist eine nichtparametrische Imputationsmethode für gemischt-typische tabellarische Daten in R. Sie verarbeitet numerische und kategoriale Variablen gleichzeitig, indem sie iterativ Random Forests trainiert, um fehlende Werte aus den beobachteten zu schätzen. Keine expliziten Modellannahmen, keine Matrixfaktorisierungen – nur starke prädiktive Baselines, die sofort funktionieren.

Das Paket enthält außerdem Werkzeuge zur Messung des Imputationsfehlers, zur Generierung von Missingness für Experimente und zur Inspektion von Variablentypen.


Installation

# CRAN (recommended)
install.packages("missForest")

Development version (from GitHub)

install.packages("remotes")

remotes::install_github("stekhoven/missForest")


Quick start

library(missForest)

Example data

data(iris)

Introduce ~20% MCAR missingness

set.seed(81) iris_mis <- prodNA(iris, noNA = 0.20)

Impute with default backend (ranger)

imp <- missForest(iris_mis, xtrue = iris, verbose = TRUE)

Imputed data

head(imp$ximp)

Estimated OOB errors (NRMSE for numeric, PFC for factors)

imp$OOBerror

True error if xtrue was provided (for benchmarking only)

imp$error

Auswahl eines Backends

# Legacy behavior using randomForest
imp_rf <- missForest(iris_mis, backend = "randomForest")

Explicitly use ranger with limited threads

imp_rg <- missForest(iris_mis, backend = "ranger", num.threads = 2)

Parallelisierung

Zwei Modi sind über parallelize verfügbar:

# Not run:

library(doParallel)

registerDoParallel(2)

imp_vars <- missForest(iris_mis, parallelize = "variables", verbose = TRUE)

imp_fors <- missForest(iris_mis, parallelize = "forests", verbose = TRUE, num.threads = 2)


API-Übersicht

missForest(xmis, ...)

Kern-Imputationsfunktion.

Wichtige Argumente:

Einige Argument-Zuordnungen für backend = "ranger":

Hilfsfunktionen

---

Tipps & bewährte Methoden

  set.seed(123); imp <- missForest(x)
  ``
  • Sie können ntree während der Prototypenerstellung reduzieren, um die Iteration zu beschleunigen.
---

Zitation

Wenn Sie missForest verwenden, zitieren Sie bitte:

Stekhoven, D. J. & Bühlmann, P. (2012). MissForest—nichtparametrische Imputation fehlender Werte für gemischte Datentypen.* Bioinformatics, 28(1), 112–118. https://doi.org/10.1093/bioinformatics/btr597

Sie können auch das Paket zitieren:

r citation("missForest") ``


Contributing

Issues and pull requests are welcome. Please include a minimal reproducible example when reporting bugs. For performance discussions, share small benchmarks and session info.


License

GPL (≥ 2)


Contact

Daniel J. Stekhoven — stekhoven@nexus.ethz.ch


--- Tranlated By Open Ai Tx | Last indexed: 2026-07-17 ---