Here is an example code for calculating Root Mean Squared Error (RMSE) in Python using Numpy and Math libraries.
main.py378 chars15 lines
Output:
main.py45 chars2 lines
Here, we first define the actual and predicted values as numpy arrays. Then, we subtract predicted values from actual values, square the result and find the mean with numpy. Finally, we take the square root of mean squared error to get the RMSE value using Math library.
gistlibby LogSnag