sethah opened a new pull request #9777: Mx 9588 URL: https://github.com/apache/incubator-mxnet/pull/9777 ## Description ## This PR adds a mixin class that F1 and other metrics like precision and recall can leverage in the future. It also provides a new option for the F1 metric called `average` which defines how the metric will be aggregated across mini batches. ## Checklist ## ### Essentials ### - [X] Passed code style checking (`make lint`) - [X] Changes are complete (i.e. I finished coding on this PR) - [X] All changes have test coverage: - Unit tests are added for small changes to verify correctness (e.g. adding a new operator) - Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore) - Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL) - [X] Code is well-documented: - For user-facing API changes, API doc string has been updated. - For new C++ functions in header files, their functionalities and arguments are documented. - For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable - [X] To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change ## Approach The "micro" vs "macro" update strategy is not specific to F1 score. The macro update just takes an average of averages, which can be done for any metric. It may be best to design an abstraction where any metric can have the micro/macro update option, but I couldn't see a good way to do that here that would: * be easy to use for end users AND * maintain backward compatibility AND * maintain current semantics For now, the behavior for each type of update is hard coded into the `update` method of the `F1` class. We can discuss the approach. Please let me know if I have missed or overlooked anything :)
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services