Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Weighted average scores no nan #14595
Finishes #10891 by adding a regression test.
Some metrics can produce NaN scores which are however 0-weighted (e.g. PR curve score calculated on class with no positive ground truth samples in the batch). When directly taking weighted average of them, the NaN scores can cause the average score to be NaN, even if they are 0-weighted. To prevent this, before taking the average, we force the scores with 0 weight to be 0, so that they will not pose effect on the final average score.