Confusion Matrices - Part 2
This post takes off where the last one left off and talks about building confusion matrices for multi-class classification problems. We load the Iris dataset, split it into training and test sets, build a K-Nearest Neighbors (k-NN) classifier that attempts to predict the class of Iris plant (setosa, versicolor, or virginica), and craft a confusion matrix using these predictions. We then describe some additional metrics, including the macro and micro precision, and discuss sklearn's classification_report, discussing the $F_1$ metric and delving slightly deeper into the $F_{0.5}$ In the end, we discuss the classification_report for the confusion matrix we built on the Iris dataset. Let's import the needed libraries and set the matplotlib and seaborn settings.
Jul-12-2022, 01:25:42 GMT
- Technology: