1. First, we need to calculate the residual errors. Residual errors are the difference between the actual values and predicted values.
Sample |
Feature 1 |
Feature 2 |
Actual Value |
Predicted Value |
Residual Error (Actual - Predicted) |
1 |
2 |
3 |
4 |
6 |
-2 |
2 |
3 |
4 |
5 |
7 |
-2 |
3 |
4 |
5 |
6 |
7 |
-1 |
4 |
5 |
6 |
7 |
8 |
-1 |
5 |
6 |
7 |
8 |
9 |
-1 |
- Next, we can calculate the MSE by taking the average of the squared residual errors.
$MSE = ((-2)^2 + (-1)^2 + (-1)^2 + (-1)^2 + (-1)^2) / 5 = 10 / 5 = 2$
- To calculate the MAE, we take the average of the absolute residual errors.
$MAE = (|-2| + |-1| + |-1| + |-1| + |-1|) / 5 = 6 / 5 = 1.2$
- Finally, to calculate the RMSE, we take the square root of the MSE.
$RMSE = sqrt(2) = 1.41$
Therefore, the residual errors are [-2, -1, -1, -1, -1], the MSE is 2, the MAE is 1.2, and the RMSE is 1.41.