Computing MSE and median absolute error

The mean squared error (MSE) and median absolute error (MedAE) are popular regression metrics. They are given by the following equations:

Computing MSE and median absolute error

The MSE (10.6) is analogous to population variance. The square root of the MSE (RMSE) is, therefore, analogous to standard deviation. The units of the MSE are the same as the variable under analysis—in our case, temperature. An ideal fit has zero-valued residuals and, therefore, its MSE is equal to zero. Since we are dealing with squared errors, the MSE has values that are larger or ideally equal to zero.

The MedAE is similar to the MSE, but we start with the absolute values ...

Get Python Data Analysis Cookbook 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.