-
Notifications
You must be signed in to change notification settings - Fork 727
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
Potential conflict with sklearn metrics? #4
Comments
What is the conflict? I didn't get any on my end. |
hi, Raj,
Sorry, it is just a warning.
/home/hawktang/anaconda3/envs/nlp/lib/python3.7/site-packages/sklearn/metrics/classification.py:872:
RuntimeWarning: invalid value encountered in double_scalars
mcc = cov_ytyp / np.sqrt(cov_ytyt * cov_ypyp)
{'mcc': 0.0, 'tp': 0, 'tn': 1, 'fp': 0, 'fn': 1}
Best,
Peter Ze TANG (汤赜)
…On Mon, Oct 7, 2019 at 10:13 PM Thilina Rajapakse ***@***.***> wrote:
What is the conflict? I didn't get any on my end.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4?email_source=notifications&email_token=AAPJIZZQOE5VRWD6FF3PPXDQNM72LA5CNFSM4I6FDW2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAQPUSQ#issuecomment-539032138>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAPJIZ4MLAGXEUNXHUAYPALQNM72LANCNFSM4I6FDW2A>
.
|
Ah, that is likely due to the fact that there are no true positives. It shouldn't be an issue on a real dataset. |
I am geting a similar issue. The model is predicting all negatives on a real dataset. after 20 epochs /home/ubuntu/anaconda3/lib/python3.7/site-packages/sklearn/metrics/classification.py:872: RuntimeWarning: invalid value encountered in double_scalars result={'mcc': 0.0, 'tp': 0, 'tn': 6000, 'fp': 0, 'fn': 4679} |
Hi |
You can't compute an MCC score when the predictions are invalid as a number divided by zero (which is what is happening here) is undefined. |
Thanks, @ThilinaRajapakse. |
It tends to happen in the early stages of training because the model is basically doing random predictions at that stage. It can also happen if the model is being trained with too large learning rates because the model will end up predicting the same label for all inputs. |
In case new users come to this post like I did searching for answers as to why you received "RuntimeWarning: invalid value encountered in double_scalars My reason was that my dataset was portioned into invalid training, validation, and testing allocations. |
Any updated, it seems that evaluation has some confilt with sklearn metrics.
On Mon, 7 Oct 2019, 10:02 pm Thilina Rajapakse, notifications@github.com
wrote:
Originally posted by @hawktang in #3 (comment)
The text was updated successfully, but these errors were encountered: