It is now time to get a sense of how useful this package is, by computing the confusion matrix for all of the models we have previously fitted:
- Logistic regression
- Support vector machine
- Random forest
The function we are going to employ here is the confusionMatrix() function, which basically takes the vector of predicted values and the vector of observed values (order here is not irrelevant) and produces as an output an appropriate confusion matrix. Moreover, it produces a whole set of metrics commutable from confusion matrices, as shown within the pertaining documentation, given the following confusion matrix:
Reference | ||
Predicted | Event | No Event |
Event | A | B |
No Event | C | D |
The ...