Skip to content

Commit

Permalink
Fix test of IoU against sklearn jaccard
Browse files Browse the repository at this point in the history
Use macro instead of micro averaging in sklearn's jaccard score, to
match multi-class IoU, which conventionally takes per-class scores
before averaging.
  • Loading branch information
abrahambotros committed Sep 15, 2020
1 parent 97f95ab commit 42ef161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/metrics/functional/test_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

@pytest.mark.parametrize(['sklearn_metric', 'torch_metric'], [
pytest.param(sk_accuracy, accuracy, id='accuracy'),
pytest.param(partial(sk_jaccard_score, average='micro'), iou, id='iou'),
pytest.param(partial(sk_jaccard_score, average='macro'), iou, id='iou'),
pytest.param(partial(sk_precision, average='micro'), precision, id='precision'),
pytest.param(partial(sk_recall, average='micro'), recall, id='recall'),
pytest.param(partial(sk_f1_score, average='micro'), f1_score, id='f1_score'),
Expand Down

0 comments on commit 42ef161

Please sign in to comment.