Calculate the Root Mean Square Error (RMSE) between actual and predicted values. RMSE is a standard metric for measuring the accuracy of regression predictions.
def rmse(y_true, y_pred):
n = len(y_true)
mse = sum((yt - yp) ** 2 for yt, yp in zip(y_true, y_pred)) / n
return round(mse ** 0.5, 4)