Database Reference
In-Depth Information
math.pow((actual - predicted), 2)
}.reduce(_ + _) / ratingsAndPredictions.count
println("Mean Squared Error = " + MSE)
The output is as follows:
Mean Squared Error = 0.08231947642632852
It is common to use the Root Mean Squared Error ( RMSE ), which is just the square
root of the MSE metric. This is somewhat more interpretable, as it is in the same units as
the underlying data (that is, the ratings in this case). It is equivalent to the standard devi-
ation of the differences between the predicted and actual ratings. We can compute it
simply as follows:
val RMSE = math.sqrt(MSE)
println("Root Mean Squared Error = " + RMSE)
The preceding code will print the Root Mean Squared Error:
Root Mean Squared Error = 0.2869137090247319
Search WWH ::




Custom Search