powered by
Generate a confusion matrix for Random Forest analyses with error rates translated into percent correctly classified, and columns for confidence intervals and expected classification rates (priors) added.
confusionMatrix(rf, conf.level = 0.95, threshold = 0.8)
a randomForest object.
randomForest
confidence level for the binom.test confidence interval
binom.test
threshold to test observed classification probability against.
classConfInt, exptdErrRate
classConfInt
exptdErrRate
# NOT RUN { data(mtcars) rf <- randomForest(factor(am) ~ ., mtcars, importance = TRUE) confusionMatrix(rf) # }
Run the code above in your browser using DataLab