Skip to content

Commit 688d38c

Browse files
danlamannabrianhelba
authored andcommitted
Add tests for validation metric
1 parent 44b4230 commit 688d38c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/test_classification.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
1-
from isic_challenge_scoring.classification import ClassificationScore
1+
import pytest
2+
3+
from isic_challenge_scoring.classification import ClassificationScore, ValidationMetric
24

35

46
def test_score(classification_truth_file_path, classification_prediction_file_path):
57
assert ClassificationScore.from_file(
68
classification_truth_file_path, classification_prediction_file_path
79
)
10+
11+
12+
@pytest.mark.parametrize(
13+
'validation_metric',
14+
[ValidationMetric.AUC, ValidationMetric.BALANCED_ACCURACY, ValidationMetric.AVERAGE_PRECISION],
15+
)
16+
def test_score_validation_metric(
17+
classification_truth_file_path, classification_prediction_file_path, validation_metric
18+
):
19+
score = ClassificationScore.from_file(
20+
classification_truth_file_path,
21+
classification_prediction_file_path,
22+
validation_metric=validation_metric,
23+
)
24+
assert isinstance(score.validation, float)

0 commit comments

Comments
 (0)