8000 fixed pep8 violations · scikit-learn/scikit-learn@429111d · GitHub
[go: up one dir, main page]

Skip to content

Commit 429111d

Browse files
committed
fixed pep8 violations
1 parent f26196a commit 429111d

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

sklearn/metrics/tests/test_ranking.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -697,13 +697,13 @@ def test_binary_clf_curve_implicit_pos_label(curve_func):
697697
# The error message is slightly different for bytes-encoded
698698
# class labels, but otherwise the behavior is the same:
699699
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."),
703703
('Labels represented as bytes is not supported.'
704704
' 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))):
707707
roc_curve(np.array([b"a", b"b"], dtype='<S1'), [0., 1.])
708708

709709
# Check that it is possible to use floating point class labels
@@ -953,8 +953,7 @@ def test_score_scale_invariance():
953953
([1, 0, 1], [0.5, 0.75, 1], [1, 1, 0], [0, 0.5, 0.5]),
954954
([1, 0, 1], [0.25, 0.5, 0.75], [1, 1, 0], [0, 0.5, 0.5]),
955955
])
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):
958957
# Check on a batch of small examples.
959958
fpr, fnr, _ = det_curve(y_true, y_score)
960959

@@ -972,9 +971,7 @@ def test_det_curve_toydata(y_true, y_score,
972971
([1, 0, 1], [0.25, 0.5, 0.5], [1], [0]),
973972
([1, 1, 0], [0.25, 0.5, 0.5], [1], [0]),
974973
])
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):
978975
fpr, fnr, _ = det_curve(y_true, y_score)
979976

980977
assert_allclose(fpr, expected_fpr)

sklearn/utils/tests/test_multiclass.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,12 +438,12 @@ def test_ovr_decision_function():
438438

439439
assert_allclose(dec_values, dec_values_one, atol=1e-6)
440440

441+
441442
def test_labels_in_bytes_format():
442443
# test whether labels are represented in bytes format
443444
# and display a helpful message
444445
msg = ('Labels represented as bytes is not supported.'
445446
' Convert the labels to a supported format.'
446-
' For example, y = y.astype\(str\)')
447+
' For example, y = y.astype'r'\(str\)')
447448
with pytest.raises(ValueError, match=msg):
448449
type_of_target(np.array([b'a', b'b'], dtype='<S1'))
449-

0 commit comments

Comments
 (0)
0