tidyHeatmap
## randomForest 4.6-14
## Type rfNews() to see new features/changes/bug fixes.
## AUC 0.3.0
## Type AUCNews() to see the change log and ?AUC to get an overview.
## Warning in require_bit64_if_needed(ans): Some columns are type 'integer64'
## but package bit64 is not installed. Those columns will print as strange
## looking floating point data. There is no need to reload the data. Simply
## install.packages('bit64') to obtain the integer64 print method and print the
## data again.
## [1] 1024 86
mn01 <- mn[, c("FC_RU", "Default_AADT", "HU", "Pop" , "WAC", "RAC", "Agg_Inc", "Agg_Veh", "Empl" )]
mn02= na.omit(mn01)
mn02$FC_RU= as.factor(mn02$FC_RU)
mn02 <- mn02[,-c(2)]
x <- mn02[, -1]
y <- mn02$FC_RU
#train default model and the most regularized model with same predictive performance
rf.default = randomForest(x,y,ntree=5000)
rf.robust = randomForest(x,y,sampsize=25,ntree=5000,mtry=4,
keep.inbag = T,keep.forest = T)
#verify similar performance
plot(roc(rf.default$votes[,2],y),main="ROC: default black, robust is red")
plot(roc(rf.robust$votes[,2],y),col=2,add = T)

## [1] 0.7506225
## [1] 0.581554
