3
$\begingroup$

I use missforest to deal with missing values on a given dataframe df_1.

I would like to know if it is possible to use missforest on a new dataframe df_2 without recomputing.

Can I use the "recipe" for completing missing values established on a previous dataframe on a new one ?

I am currently using R.

$\endgroup$

1 Answer 1

0
$\begingroup$

This is a non-trivial task. Reason is that even if you would store all models fitted by MissForest, it is not obvious how to apply them to fill gaps in more than one variable. One possibility would be to initially fill all gaps univariately (hot-deck or mean imputation e.g.) and then replace these by predictions from the originally fitted random forests until stabilization.

Another problem is that if your first data set is large, then tons and tons of disk space will be necessary to store a random forest for each variable.

$\endgroup$
3
  • $\begingroup$ I think the OP is asking about using MissForest to fill missing values in another dataset. An example would be - Using missforest to fill missing values in train data and then using that missforest model (if there is a way to reuse) to fill missing values in test data (without building a different model for test). $\endgroup$
    – Ankit Seth
    Commented Feb 26, 2021 at 6:24
  • $\begingroup$ This is exactly the problem I tried to explain. Once trained, the models in missForest do not accept missing values in their input anymore. How to apply these trained models on a new dataset with missing values in multiple columns? $\endgroup$
    – Michael M
    Commented Feb 26, 2021 at 6:48
  • $\begingroup$ I don't know abut the part - "the models in missForest do not accept missing values in their input anymore". I recently used missForest to fill missing values in train data. My data had NA in multiple columns and they were filled. Now I wanted to fill missing values in test data. If I just simply use missforest on test, It will create new models and fill values based on test data which will be wrong. And so far (from what I have found), there is no way to reuse missingforest trained models to fill test data values. $\endgroup$
    – Ankit Seth
    Commented Feb 26, 2021 at 7:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.