Understanding the Confusion Matrix for Model Evaluation & Monitoring

Datatron
Datatron
Published in
5 min readApr 10, 2020

--

Introduction

Anyone can build a machine learning (ML) model with a few lines of code, but building a good machine learning model is a whole other story.

What do I mean by a GOOD machine learning model?

It depends, but generally, you’ll evaluate your machine learning model based on some predetermined metrics that you decide to use. When it comes to building classification models, you’ll most likely use a confusion matrix and related metrics to evaluate your model. Confusion matrices are not just useful in model evaluation but also model monitoring and model management!

Don’t worry, we’re not talking about linear algebra matrices here!

In this article, we’ll cover what a confusion matrix is, some key terms and metrics, an example of a 2×2 matrix, and all of the related python code.

With that said, let’s dive into it!

What is a Confusion Matrix?

A confusion matrix, also known as an error matrix, is a summarized table used to assess the performance of a classification model. The number of correct and incorrect predictions are summarized with count values and broken down by each class.

--

--