-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
Open
Labels
Description
Describe the bug
By definition balanced accuracy should be equal to recall averaged over all the classes. Current implementation gives different answers. Please see the example below.
import scikit.metrics as skm
y_true = [1,1]
y_pred = [1,2]
skm.recall_score(y_true, y_pred, average='macro') # 0.25
skm.balanced_accuracy_score(y_true, y_pred) # 0.5
Steps/Code to Reproduce
import scikit.metrics as skm
y_true = [1,1]
y_pred = [1,2]
recall = skm.recall_score(y_true, y_pred, average='macro')
balanced_acc = skm.balanced_accuracy_score(y_true, y_pred)
Expected Results
recall = balaced_acc = 0.25
Actual Results
recall = 0.25
balanced_acc = 0.5
Versions
import sklearn; sklearn.show_versions()
he7d3r