Skip to content

Conversation

nithish-74
Copy link

This PR introduces a new regression metric: macro-averaged Mean Squared Error (Macro-MSE).

🔹 What it does

Adds macro_mean_squared_error to imblearn.metrics._regression.py.

Implements computation of MSE per class and returns the unweighted (macro) average.

Includes unit tests in imblearn/tests/test_regression.py to verify correctness.

🔹 Motivation
While sklearn.metrics.mean_squared_error provides sample-wise MSE, there is no built-in option for macro averaging across classes. This is particularly useful in imbalanced regression scenarios where class distributions are skewed, ensuring that minority classes contribute equally to the error metric.

🔹 Changes made

Implemented macro_mean_squared_error function.

Added corresponding test cases with multiple class distributions.

Ensured compatibility with scikit-learn’s API style.

🔹 Next steps

Documentation update (if maintainers prefer exposing this in the public API).

Feedback welcome on naming, placement, and test coverage.

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