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
UndefinedMetricWarnings while running classification/main_train.py on SEN12MS #52
Comments
Precision is ill-defined and being set to 0.0 in labels with no predicted samples. Use This was done intentionally to give a warning based on the discussion: scikit-learn/scikit-learn#14876 Summary from the sklearn/metrics/_classification.py code: Divide, and on zero-division, set scores and/or warn according to zero_division:
warn for f-score only if zero_division is warn, it is in warn_for and BOTH prec and rec are ill-defined
` |
One idea is to remove the classes that do not have samples, not sure how complicated it is. |
The code is in https://github.com/Berkeley-Data/SEN12MS/blob/master/classification/metrics.py which calls the sklearn.metrics functions for different metrics. Those functions can take zero_division parameter. |
Getting the following warnings...Need to investigate and see if it's going to impact the results, if yes, we need to fix it.
/home/taeil/anaconda3/envs/hptest/lib/python3.7/site-packages/sklearn/metrics/_classification.py:1493: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no true nor predicted samples. Use
zero_division
parameter to control this behavior.average, "true nor predicted", 'F-score is', len(true_sum)
/home/taeil/anaconda3/envs/hptest/lib/python3.7/site-packages/sklearn/metrics/_classification.py:1493: UndefinedMetricWarning: F-score is ill-defined and being set to 0.0 in labels with no true nor predicted samples. Use
zero_division
parameter to control this behavior.average, "true nor predicted", 'F-score is', len(true_sum)
/home/taeil/anaconda3/envs/hptest/lib/python3.7/site-packages/sklearn/metrics/_classification.py:1245: UndefinedMetricWarning: Precision is ill-defined and being set to 0.0 in labels with no predicted samples. Use
zero_division
parameter to control this behavior._warn_prf(average, modifier, msg_start, len(result))
/home/taeil/anaconda3/envs/hptest/lib/python3.7/site-packages/sklearn/metrics/_classification.py:1245: UndefinedMetricWarning: Recall is ill-defined and being set to 0.0 in labels with no true samples. Use
zero_division
parameter to control this behavior._warn_prf(average, modifier, msg_start, len(result))
Validation microPrec: 0.540000 microF1: 0.540000 sampleF1: 0.540000 microF2: 0.540000 sampleF2: 0.540000
The text was updated successfully, but these errors were encountered: