I am working on a random forest in R, and I would like to add a 10x cross-validation of my model. But I'm completely stuck there. This is a sample of my code.
install.packages('randomForest')
library(randomForest)
set.seed(123)
fit <- randomForest(as.factor(sickrabbit) ~ Feature1,..., FeatureN ,data=training1, importance=TRUE,sampsize = c(200,300),ntree=500)
I found an online function rfcvin the carriage, but I'm not sure to understand how it works. Can anyone help with this feature or suggest an easier way to implement cross validation. Can you do this using a random forest pack instead of a carriage?
source
share