Explore Library
Code QuizIntermediate

Computing RMSE

Correctly deriving RMSE from squared errors.

Codepython
import numpy as np

y_true = np.array([3.0, 5.0, 2.5])
y_pred = np.array([2.5, 5.0, 4.0])

mse = np.mean((y_true - y_pred) ** 2)
# Root mean squared error
rmse = np.mean(np.sqrt((y_true - y_pred) ** 2))
print(rmse)

The variable rmse is supposed to be the root mean squared error. What is the bug?