Displaying 1 result from an estimated 1 matches for "data_missing".
2009 Mar 11
0
problem with rfImpute (package randomForest)
...ncer)
data=BreastCancer[,-1]
data=data[!is.na(data[,"Bare.nuclei"]),]
summary(data)
is.factor(data$Cl.thickness)# OK
##########selection of missing values######
x=1:nrow(data)
sample1=sample(x,70)
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.thic...