@@ -697,13 +697,13 @@ def test_binary_clf_curve_implicit_pos_label(curve_func):
697
697
# The error message is slightly different for bytes-encoded
698
698
# class labels, but otherwise the behavior is the same:
699
699
msg = (("y_true takes value in {b'a', b'b'} and pos_label is "
700
- "not specified: either make y_true take "
701
- "value in {0, 1} or {-1, 1} or pass pos_label "
702
- "explicitly." ),
700
+ "not specified: either make y_true take "
701
+ "value in {0, 1} or {-1, 1} or pass pos_label "
702
+ "explicitly." ),
703
703
('Labels represented as bytes is not supported.'
704
704
' Convert the labels to a supported format.'
705
- ' For example, y = y.astype\(str\)' ))
706
- with pytest .raises (ValueError , match = re .compile ( '|' .join ( msg ) )):
705
+ ' For example, y = y.astype' r' \(str\)' ))
706
+ with pytest .raises (ValueError , match = re .compile ('|' .join (msg ))):
707
707
roc_curve (np .array ([b"a" , b"b" ], dtype = '<S1' ), [0. , 1. ])
708
708
709
709
# Check that it is possible to use floating point class labels
@@ -953,8 +953,7 @@ def test_score_scale_invariance():
953
953
([1 , 0 , 1 ], [0.5 , 0.75 , 1 ], [1 , 1 , 0 ], [0 , 0.5 , 0.5 ]),
954
954
([1 , 0 , 1 ], [0.25 , 0.5 , 0.75 ], [1 , 1 , 0 ], [0 , 0.5 , 0.5 ]),
955
955
])
956
- def test_det_curve_toydata (y_true , y_score ,
957
- expected_fpr , expected_fnr ):
956
+ def test_det_curve_toydata (y_true , y_score , expected_fpr , expected_fnr ):
958
957
# Check on a batch of small examples.
959
958
fpr , fnr , _ = det_curve (y_true , y_score )
960
959
@@ -972,9 +971,7 @@ def test_det_curve_toydata(y_true, y_score,
972
971
([1 , 0 , 1 ], [0.25 , 0.5 , 0.5 ], [1 ], [0 ]),
973
972
([1 , 1 , 0 ], [0.25 , 0.5 , 0.5 ], [1 ], [0 ]),
974
973
])
975
- def test_det_curve_tie_handling (y_true , y_score ,
976
- expected_fpr ,
977
- expected_fnr ):
974
+ def test_det_curve_tie_handling (y_true , y_score , expected_fpr , expected_fnr ):
978
975
fpr , fnr , _ = det_curve (y_true , y_score )
979
976
980
977
assert_allclose (fpr , expected_fpr )
0 commit comments