Generating error/classification-confusion matrices

You might build a classification model and want to evaluate the model by comparing the model's predictions with the actual outcomes. You will typically do this on the holdout data. Getting an idea of how the model does in training data itself is also useful, but you should never use that as an objective measure.

Getting ready

If you have not already downloaded the files for this chapter, do so now and ensure that the college-perf.csv file is in your R working directory. The file has data about a set of college students. The Perf variable has their college performance classified as High, Medium, or Low. The Pred variable contains a classification model's predictions of the performance level. The ...

Get R: Recipes for Analysis, Visualization and Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.