I tried to calculate the mse value for a test set by hand and by using the MSE function from the MLmetrics package but get different results.
Here is a reproducible example:
ActualValuesExample <- c(1,1,3,3,2,5,1)
MSE(PredictionExample,ActualValuesExample)
Bias <- mean(PredictionExample-ActualValuesExample)
Variance <- mean((PredictionExample-ActualValuesExample)^2)
# MSE = Bias^2 + Variance
(Bias)^2 + Variance
0.4489796 is the result for the computation by hand and 0.4285714 the result of the MSE function.
Where is my mistake, why i dotn get the same results?