Is there a library function for Root mean square error (RMSE) in python?

sklearn >= 0.22.0 sklearn.metrics has a mean_squared_error function with a squared kwarg (defaults to True). Setting squared to False will return the RMSE. from sklearn.metrics import mean_squared_error rms = mean_squared_error(y_actual, y_predicted, squared=False) sklearn < 0.22.0 sklearn.metrics has a mean_squared_error function. The RMSE is just the square root of whatever it returns. from sklearn.metrics import mean_squared_error … Read more

Moving average or running mean

UPDATE: more efficient solutions have been proposed, uniform_filter1d from scipy being probably the best among the “standard” 3rd-party libraries, and some newer or specialized libraries are available too. You can use np.convolve for that: np.convolve(x, np.ones(N)/N, mode=”valid”) Explanation The running mean is a case of the mathematical operation of convolution. For the running mean, you … Read more

Relationship between SciPy and NumPy

Last time I checked it, the scipy __init__ method executes a from numpy import * so that the whole numpy namespace is included into scipy when the scipy module is imported. The log10 behavior you are describing is interesting, because both versions are coming from numpy. One is a ufunc, the other is a numpy.lib … Read more