# 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)
# Needed packages
from sklearn.metrics import mean_squared_error
# Values to compare
y_true = [3, -0.5, 2, 7] # Observed value
y_pred = [2.5, 0.0, 2, 8] # Predicted value
# Mean squared error
mse = mean_squared_error(y_true, y_pred)
print(mse)
from sklearn.metrics import mean_squared_error
from math import sqrt
actual_values = [3, -0.5, 2, 7]
predicted_values = [2.5, 0.0, 2, 8]
mean_squared_error(actual_values, predicted_values)
# taking root of mean squared error
root_mean_squared_error = sqrt(mean_squared_error)