Addressing issue #215 - G-mean for multi-class problems #219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference Issue
Fixes #215
What does this implement/fix? Explain your changes.
Adds the possibility of calculating G-mean for multi-class problems without resorting to averaging binary G-mean values. At the same time G-mean can still be average on a class-wise basis. This implementation also adds the possibility of "correcting" unrecognized class recalls from zero to a user-specified value. This is only works when
average == 'multiclass'
.Additional comment
In the
report_imbalanced_multiclass()
I left the resulting report as it was, since it is designed to show the results separately for each class. You may, however, consider to extend this report to have a header with overall accuracy and overall G-mean (as single lines above the table). I'm not sure if you want to add that, especially that accuracy works a little bit differently than the measures you implemented in themetrics
module. Therefore maybe it is best to leave this as it is.