What is the Mean Absolute Error (MAE)?
Let’s say we created a linear regression model. The expected output of the model is: [ya1, ya2, ya3, … yan] And the model gave the following output: [y1, y2, …, yn] The Mean Absolute Error (MAE) is the average of absolute error that is obtained by subtracting the actual output from the predicted output.
In other words, the Mean Absolute Error (MAE) is calculated using the following formula:
Here, n is the total number of observations.
What is the Mean Squared Error (MSE)?
The Mean Squared Error (MSE) is obtained by squaring the absolute error and then, dividing the result with the total number of observations n.
In other words, if a model gives the output [y1, y2, …, yn] and the expected output is [ya1, ya2, ya3, … yan] then, the Mean Squared Error (MSE) is calculated using the following formula:
What is the Root Mean Squared Error (RMSE)?
The Root Mean Squared Error (RMSE) is obtained by taking a square root of the Mean Squared Error (MSE). In other words, if a model gives the output [y1, y2, …, yn] and the expected output is [ya1, ya2, …, yan] then, the Mean Squared Error (MSE) is calculated using the following formula:
How to calculate Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE) using Python?
We can use the following Python code to calculate the Mean Absolute Error (MAE), Mean Squared Error (MSE), and Root Mean Squared Error (RMSE)…






0 Comments