-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Matthews correlation coefficient metric throws misleading division by zero RuntimeWarning #16924
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
Comments
Can I take this one? Not sure check if only one column or row of confusion matrix has nonzero values will work though. According to Jurman, Riccadonna, Furlanello, (2012). A Comparison of MCC and CEN Error Measures in MultiClass Prediction
and Wikipedia of Matthews correlation coefficient,
the fix planned above looks reasonable to me. |
This is still happening. |
A pull request is welcome. @Connerrrrr are you still interested? |
Sure, working on it. |
@jnothman PR was created. |
Was this solved in 2022? I'm still getting this error RuntimeWarning: invalid value encountered in double_scalars |
@scienception Any guidance of reproduce the error? |
Description
With tested values all equal,
sklearn.metrics.matthews_corrcoef
throws aRuntimeWarning
reporting a division by zero. This behavior was already reported in #1937 and reported fixed, but reappears in recent versions.Steps/Code to Reproduce
The snippet below reproduces the warning.
Expected Results
No warning is thrown.
Actual Results
The following warning is thrown:
Versions
The text was updated successfully, but these errors were encountered: