October 2017
Beginner to intermediate
572 pages
26h 1m
English
In this recipe, we demonstrate how to obtain a confusion matrix to measure the performance of a classification model. First, we use the train function from the caret package to train an svm model. Next, we use the predict function to extract the predicted labels of the svm model using the testing dataset. Then, we perform the table function to obtain the classification table based on the predicted and actual labels. Finally, we use the confusionMatrix function from the caret package to generate a confusion matrix to measure the performance of the classification model.
Read now
Unlock full access