Skip to content

Enhancement: Add explicit UserWarning for NaN classes in macro-averaged metrics#558

Open
karttikjangid wants to merge 4 commits intoJdeRobot:masterfrom
karttikjangid:fix/warnings
Open

Enhancement: Add explicit UserWarning for NaN classes in macro-averaged metrics#558
karttikjangid wants to merge 4 commits intoJdeRobot:masterfrom
karttikjangid:fix/warnings

Conversation

@karttikjangid
Copy link
Copy Markdown
Contributor

Fixes #546

Following up on the discussion in #546, this PR adds a UserWarning during macro-averaged metric calculation.

When per-class metric values are NaN (for example, denominator-zero cases such as classes missing from the confusion matrix), they are ignored by np.nanmean as intended. This PR now surfaces a warning indicating how many classes were dropped for that metric so researchers are explicitly aware of the macro-average context.

All existing metric formulas and public APIs are unchanged. Feedback on the warning text format is welcome.

@karttikjangid
Copy link
Copy Markdown
Contributor Author

Hi team, the CI is failing on LiDAR tests due to an isinstance check against a mocked Open3D class in the headless runner. My changes are limited to metrics; would you like me to include a small guard to fix this CI bottleneck?

@karttikjangid
Copy link
Copy Markdown
Contributor Author

I have reinstated the original poetry files for reference in the last commit

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.

[Enhancement + Bug] Better error handling for data ingestion and missing classes

1 participant