Skip to content

Conversation

@darshbaxi
Copy link
Contributor

@darshbaxi darshbaxi commented Oct 16, 2025

Description

This PR adds the Root Mean Squared Error (RMSE) metric for regression tasks. RMSE is a widely used evaluation metric that measures the average magnitude of errors between predicted and actual values.

Features added:

  • root_mean_squared_error(y_true, y_pred) function
  • Unit test in tests/test_metrics.py with example calculation

Changes Included

  1. New Metric Function:

    • Added root_mean_squared_error(y_true, y_pred) in pydeepflow.metrics.
    • Computes RMSE for regression tasks using the formula:
      [
      \text{RMSE} = \sqrt{\frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2}
      ]
  2. Unit Tests:

    • Added test_root_mean_squared_error in tests/test_metrics.py.
    • Validates the RMSE calculation with example data:
      y_true = [3, -0.5, 2, 7]
      y_pred = [2.5, 0.0, 2, 8]
      RMSE = 0.6123724356957945

closes #111

@darshbaxi darshbaxi changed the title Add Root Mean Squared Error (RMSE) metric to pydeepflow.metrics #111 Add Root Mean Squared Error (RMSE) metric to pydeepflow.metrics (#111) Oct 16, 2025
@ravin-d-27
Copy link
Owner

Hi @darshbaxi ! good work! would be great if you resolve the merge conflicts, I'll be happy to merge!

@darshbaxi
Copy link
Contributor Author

Hey! @ravin-d-27, I’ve resolved the merge conflicts.

Copy link
Owner

@ravin-d-27 ravin-d-27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @darshbaxi ! Thank you!

@ravin-d-27 ravin-d-27 merged commit 62bdef7 into ravin-d-27:main Oct 26, 2025
1 check passed
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.

Add RMSE (Root Mean Squared Error) metric

2 participants