Closed
Description
Hey,
I was getting different reported values for geometric mean score when using the geometric_mean_score and was curious why. Looks like there are a few mixed up parameters in classification_report_imbalanced.
geometric_mean_score wants y_true before y_pred:
imblearn.metrics.geometric_mean_score(y_true, y_pred, labels=None, pos_label=1, average='multiclass', sample_weight=None, correction=0.0)
However, inside classification_report_imbalanced:
geo = geometric_mean_score(
y_pred,
y_true,
labels=labels,
average=None,
sample_weight=None)
So to for index balanced geometric mean:
# Index balanced accuracy
iba_gmean = make_index_balanced_accuracy(
alpha=alpha, squared=True)(geometric_mean_score)
iba = iba_gmean(
y_pred,
y_true,
labels=labels,
average=None,
sample_weight=sample_weight)
On average, the results are quite different:
PRE ++ REC ++ SPE ++ F1 ++ GEO ++ IBA
0.496 ## 0.485 ## 0.904 ## 0.462 ## 0.637 ## 0.407
pre rec spe f1 geo iba sup
...
avg / total 0.50 0.48 0.90 0.46 0.68 0.45 2800
After changing param order I was able to get consistent results
Versions:
>>> ('Python', '2.7.10 (v2.7.10:15c95b7d81dc, May 23 2015, 09:33:12) \n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]')
>>> ('NumPy', '1.13.3')
>>> ('SciPy', '1.0.0')
>>> ('Scikit-Learn', '0.19.0')
>>> ('Imbalanced-Learn', '0.3.1')