missForest::missForest cannot handle Inf values
Closed this issue · 1 comments
blueskypie commented
if xmis
in missForest::missForest
contains Inf
, it crashes with the following error:
Error in randomForest.default(x = obsX, y = obsY, ntree = ntree, mtry = mtry, :
NA/NaN/Inf in foreign function call (arg 1)
it'd be helpful to handle this case to avoid crash, e.g. change Inf to NA.
stekhoven commented
the crash is provoked by randomForest() not missForest() however having Inf
in your data is generally not advisable as no regression method will be able to handle it (at least not without any tweaking/setting involved). Replacing it with NA
will also not help, as this would either provoke the exact same error from randomForest() or break the imputation process of missForest.
Bottomline: avoid having Inf
in your data.