Skip to content

Commit ab90b72

Browse files
committed
add test
1 parent 7d3492f commit ab90b72

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/system/small/ml/test_metrics.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,20 @@ def test_precision_score_binary(session, pos_label, expected_score):
766766
assert precision_score == pytest.approx(expected_score)
767767

768768

769+
def test_precision_score_binary_default_arguments(session):
770+
pd_df = pd.DataFrame(
771+
{
772+
"y_true": [1, 1, 1, 0, 0],
773+
"y_pred": [0, 0, 1, 1, 1],
774+
}
775+
)
776+
df = session.read_pandas(pd_df)
777+
778+
precision_score = metrics.precision_score(df["y_true"], df["y_pred"])
779+
780+
assert precision_score == pytest.approx(1 / 3)
781+
782+
769783
@pytest.mark.parametrize(
770784
("y_true", "y_pred", "pos_label"),
771785
[

0 commit comments

Comments
 (0)