Error metrics
Error metrics evaluate 'how wrong' the recommender system was in predicting a rating
MAE
Bases: ErrorMetric
The MAE (Mean Absolute Error) metric is calculated as such for the single user:
Where:
- \(T_u\) is the test set of the user \(u\)
- \(r_{u, i}\) is the actual score give by user \(u\) to item \(i\)
- \(\hat{r}_{u, i}\) is the predicted score give by user \(u\) to item \(i\)
And it is calculated as such for the entire system:
Where:
- \(T\) is the test set
- \(MAE_u\) is the MAE calculated for user \(u\)
There may be cases in which some items of the test set of the user could not be predicted (eg. A CBRS was chosen and items were not present locally, a methodology different than TestRatings was chosen).
In those cases the \(MAE_u\) formula becomes
Where:
- \(unk\) (unknown) is the number of items of the user test set that could not be predicted
If no items of the user test set has been predicted (\(|T_u| - unk = 0\)), then:
MSE
Bases: ErrorMetric
The MSE (Mean Squared Error) metric is calculated as such for the single user:
Where:
- \(T_u\) is the test set of the user \(u\)
- \(r_{u, i}\) is the actual score give by user \(u\) to item \(i\)
- \(\hat{r}_{u, i}\) is the predicted score give by user \(u\) to item \(i\)
And it is calculated as such for the entire system:
$$ MSE_{sys} = \sum_{u \in T} \frac{MSE_u}{|T|} $$ Where:
- \(T\) is the test set
- \(MSE_u\) is the MSE calculated for user \(u\)
There may be cases in which some items of the test set of the user could not be predicted (eg. A CBRS was chosen and items were not present locally)
In those cases the \(MSE_u\) formula becomes
Where:
- \(unk\) (unknown) is the number of items of the user test set that could not be predicted
If no items of the user test set has been predicted (\(|T_u| - unk = 0\)), then:
RMSE
Bases: ErrorMetric
The RMSE (Root Mean Squared Error) metric is calculated as such for the single user:
Where:
- \(T_u\) is the test set of the user \(u\)
- \(r_{u, i}\) is the actual score give by user \(u\) to item \(i\)
- \(\hat{r}_{u, i}\) is the predicted score give by user \(u\) to item \(i\)
And it is calculated as such for the entire system:
Where:
- \(T\) is the test set
- \(RMSE_u\) is the RMSE calculated for user \(u\)
There may be cases in which some items of the test set of the user could not be predicted (eg. A CBRS was chosen and items were not present locally, a methodology different than TestRatings was chosen).
In those cases the \(RMSE_u\) formula becomes
Where:
- \(unk\) (unknown) is the number of items of the user test set that could not be predicted
If no items of the user test set has been predicted (\(|T_u| - unk = 0\)), then: