Skip to content

Commit

Permalink
Update function for balanced accuracy calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcBS committed Sep 13, 2019
1 parent a4a41f4 commit 09da3e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions keras_wrapper/extra/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ def multiclass_metrics(pred_list, verbose, extra_vars, split):
#accuracy_balanced = sklearn_metrics.accuracy_score(y_gt, y_pred, sample_weight=sample_weights, )

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

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

0 comments on commit 09da3e4

Please sign in to comment.