from sklearn.metrics import mean_squared_error
from math import sqrt
rms = sqrt(mean_squared_error(y_actual, y_predicted))
# Needed packages
from sklearn.metrics import mean_squared_error
# Values to compare
y_true = [[0.5, 1],[-1, 1],[7, -6]]
y_pred = [[0, 2],[-1, 2],[8, -5]]
# Root mean squared error (by using: squared=False)
rmse = mean_squared_error(y_true, y_pred, squared=False)
print(rmse)
def rms(x):
rms = np.sqrt(np.mean(x**2))
return rms