Displaying 1 result from an estimated 1 matches for "data_imput".
Did you mean:
data_input
2009 Mar 11
0
problem with rfImpute (package randomForest)
...sample3=sample(x,70)
sample5=sample(x,70)
##########replace by missing values#########
data_missing=data
data_missing[sample1,1]=NA
data_missing[sample3,3]=NA
data_missing[sample5,5]=NA
summary(data_missing)
is.factor(data_missing$Cl.thickness)# OK
########imputation by random forest########
data_imputed <- rfImpute(Class ~ .,data_missing,iter=5,ntree=1000)
is.factor(data_imputed$Cl.thickness)# Not OK
And as you can see, rfImpute change the type of one explanatory variable. Before imputation, it was a factor. After it becomes a quantitative variable. So I don't understand what it happ...