You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When a class does not show up in a batch, the corresponding row in the confusing matrix becomes zero. As a result, division by zero happens and performance metrics for that class becomes NaN.
Test with an image whose label has 3 classes including background class (i.e. class_0, class_1, class_2) in which only class_0 and class_1 are available.
Expected behavior
The metric calculation should handle division by zero and set a value (i.e., 0) when a class is absent.
Screenshots
Example of the confusion matrix for a batch:
Then, the metrics for class_2, based on the following formula becomes NaN:
Additional context
Small epsilon value can be added in the denominator of each metric calculation formua to avoid devision by zero. Something like the following:
The text was updated successfully, but these errors were encountered:
Describe the bug
When a class does not show up in a batch, the corresponding row in the confusing matrix becomes zero. As a result, division by zero happens and performance metrics for that class becomes NaN.
geo-deep-learning/utils/metrics.py
Line 130 in 8c8250c
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The metric calculation should handle division by zero and set a value (i.e., 0) when a class is absent.
Screenshots
Example of the confusion matrix for a batch:
Then, the metrics for class_2, based on the following formula becomes NaN:
Additional context
Small epsilon value can be added in the denominator of each metric calculation formua to avoid devision by zero. Something like the following:
The text was updated successfully, but these errors were encountered: