Skip to contents

miceDRF is an R package that extends the functionality of the mice package by providing a new method for handling missing data using Distributed Random Forests (DRF).

Installation

To install the latest development version directly from GitHub, run the following code in your R console:

if (!requireNamespace("devtools", quietly = TRUE)) {
  install.packages("devtools")
}
devtools::install_github("KrystynaGrzesiak/miceDRF")

Example usage


library(miceDRF)
library(mice)

# Generate a random dataset
n <- 200
d <- 5
X <- matrix(runif(n * d), nrow = n, ncol = d)

# Introduce missing values
pmiss <- 0.2
X.NA <- apply(X, 2, function(x) {
  U <- runif(length(x))
  ifelse(U <= pmiss, NA, x)
})

# Perform imputation with DRF method
imp <- mice(X.NA, m = 1, method = "DRF")
Ximp <- complete(imp)

Citation

If you use miceDRF in your research, please cite the following work:

https://doi.org/10.48550/arXiv.2507.11297