Skip to content

Commit 09da3e4

Browse files
committed
Update function for balanced accuracy calculation.
1 parent a4a41f4 commit 09da3e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

keras_wrapper/extra/evaluation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ def multiclass_metrics(pred_list, verbose, extra_vars, split):
247247
#accuracy_balanced = sklearn_metrics.accuracy_score(y_gt, y_pred, sample_weight=sample_weights, )
248248

249249
# The following two lines should both provide the same measure (balanced accuracy)
250-
#_, accuracy_balanced, _, _ = sklearn_metrics.precision_recall_fscore_support(y_gt, y_pred, average='macro')
251-
accuracy_balanced = sklearn_metrics.balanced_accuracy_score(y_gt, y_pred)
250+
_, accuracy_balanced, _, _ = sklearn_metrics.precision_recall_fscore_support(y_gt, y_pred, average='macro')
251+
#accuracy_balanced = sklearn_metrics.balanced_accuracy_score(y_gt, y_pred)
252252

253253
# Compute Precision, Recall and F1 score
254254
precision, recall, f1, _ = sklearn_metrics.precision_recall_fscore_support(y_gt, y_pred, average='micro')

0 commit comments

Comments
 (0)