Irreverent Demystifiers

How to Use the MSE in Data Science

Mean squared error (MSE) for performance evaluation and optimization

Cassie Kozyrkov
7 min readJul 8, 2022

--

Let’s talk about a crucial piece that’s subtly missing from most discussions about the mean squared error (MSE): metrics and loss functions are not quite the same thing. You need two separate scoring functions for model performance evaluation and optimization in machine learning. The MSE could be either or neither… that’s up to you.

In a previous article, I explained this at a high level, but I didn’t give you concrete examples. In this article, I’ll show instead of tell, so you can see more clearly what I mean by performance evaluation versus optimization. I’ll use the mean squared error (MSE) for the demo, but please bear in mind that the MSE is an easy metric, but not always the best choice for your needs. Let’s dive in!

What is the MSE?

The mean squared error (MSE) is one of many metrics you could use to measure your model’s performance. You calculate the MSE by finding the errors, squaring them, and taking the mean. If this feels fuzzy or if you’re not sure what a model error is, I recommend taking a quick detour to my gentle MSE intro article before continuing.

Why might we wish to…

--

--

Cassie Kozyrkov

Chief Decision Scientist, Google. ❤️ Stats, ML/AI, data, puns, art, theatre, decision science. All views are my own. twitter.com/quaesita