Skip to content

Fix incorrect RMSE calculation #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix incorrect RMSE calculation #23

wants to merge 1 commit into from

Conversation

evenmn
Copy link

@evenmn evenmn commented May 8, 2025

This PR fixes a bug in the RMSE metric implementation.

Previously, the RMSE function was computing the square of the mean difference between two arrays X and T, rather than the mean of the squared differences. This resulted in incorrect values being returned.

Buggy implementation:

def rmse(X, T):
    return np.sqrt(np.mean(X - T) ** 2)

Corrected implementation:

def rmse(X, T):
    return np.sqrt(np.mean((X - T) ** 2))

This change ensures that the RMSE is calculated according to its standard definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant