Up to now, we have learned how to create classification models. Creating a machine learning classification model is not enough; as a business or data analyst, you also want to assess its performance so that you can deploy it in live projects.
scikit-learn offers various metrics, such as a confusion matrix, accuracy, precision, recall, and F1-score, to evaluate the performance of a model.
Confusion matrix
A confusion matrix is an approach that gives a brief statement of prediction results on a binary and multi-class classification problem. Let's assume we have to find out whether a person has diabetes or not. The concept behind the confusion matrix is to find the number of right and mistaken forecasts, which are further summarized and separated into each class. It clarifies all the confusion related to the performance of our classification model. This 2x2 matrix not only shows the error being made by our classifier but also represents...