Skip to content

G-mean incorrectly implemented for multi-class #215

@dabrze

Description

@dabrze

First of all thank you for this great package!

From what I recon G-mean can be easily used as a multi-class evaluation measure - it is simply the geometric mean of class-wise recalls. Therefore, for binary problems:
G-mean = sqrt(TP/P * TN/N)
or using a different notation
G-mean = (class1_correct/class1 * class2_correct/class2)**(1/2.)

For 3-class problems:
G-mean = (class1_correct/class1 * class2_correct/class2, * class3_correct/class3)**(1/3.)

and so on changing the root/power to 1/4., 1/5., ...

There is no need for micro or macro recalls, in fact they diminish the value of G-mean, which is innately a multi-class measure (rare thing in imbalanced learning).

Sidenote:
One thing you probably know is that G-mean can very easily turn to zero - if one class is completely unrecognized the entire evaluation comes down to zero. With problems involving hundreds of classess thats not a nice thing. Therefore, sometimes people make a "correction" and one class is completely unrecognized instead of multiplying by zero they multiply by some (parmaterized) small value, e.g. 0.001.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions