Data Science Desktop Survival Guide
by Graham Williams |
|||||
Decision Tree Performance |
Here we plot the performance of the decision tree, showing a risk chart. The areas under the recall and risk curves are also reported.
predict_te <- predict(model, ds[te, vars], type="prob")[,2]
riskchart(predict_te, actual_te, risk_te)
An error matrix shows, clockwise from the top left, the percentages of true negatives, false positives, true positives, and false negatives.
|
predict_te <- predict(model, ds[te, vars], type="class")
sum(actual_te != predict_te)/length(predict_te) # Overall error rate
actual_te %>%
table(predict_te, dnn=c("Actual", "Predicted")) %>% '*'(100/(length(predict_te))) %>% round()
|