Created
May 17, 2022 11:27
-
-
Save thebigdatajedi/a50b350b8a09c84cf2ec4c6fff159ff2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sklearn.metrics has a mean_squared_error function. The RMSE is just the square root of whatever it returns. | |
#source:https://intellipaat.com/community/1269/is-there-a-library-function-for-root-mean-square-error-rmse-in-python | |
from sklearn.metrics import mean_squared_error | |
from math import sqrt | |
rms = sqrt(mean_squared_error(y_actual, y_predicted)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was reading how to do this manually without python and then I wondered if I could do it in python.
I did a search with Google, wondering if it was already written for me and it wasn't but mean_squared_error was and all I had is go just one step further instead of composing the calculation myself so I wrote up this gist and documented the source of the code.
I have it in a gist for easy reference and because the answer to the question may get buried by other discussions and answers I explicitly bubbled it up via gist, see source ref in the code.