View source: R/mlim.preimpute.R
mlim.preimpute | R Documentation |
instead of replacing missing data with mean and mode, a smarter start-point would be to use fast imputation algorithms and then optimize the imputed dataset with mlim. this procedure usually requires less iterations and will savea lot of computation resources.
mlim.preimpute(data, preimpute = "RF", seed = NULL)
data |
data.frame with missing values |
preimpute |
character. specify the algorithm for preimputation. the supported options are "RF" (Random Forest), "mm" (mean-mode replacement), and "random" (random sampling from available data). the default is "RF", which carries a parallel random forest imputation, using all the CPUs available. the other alternative is "mm" which performs mean/mode imputation. |
seed |
integer. specify the random generator seed |
imputed data.frame
E. F. Haghish
## Not run: data(iris) # add 10% stratified missing values to one factor variable irisNA <- iris irisNA$Species <- mlim.na(irisNA$Species, p = 0.1, stratify = TRUE, seed = 2022) # run the default random forest preimputation MLIM <- mlim.preimpute(irisNA) mlim.error(MLIM, irisNA, iris) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.