Skip to content

Commit 246795f

Browse files
authored
TST Fixes test_partial_fit_oneclass (scikit-learn#19814)
1 parent 4b53fc3 commit 246795f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

sklearn/linear_model/tests/test_sgd.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,12 +1499,11 @@ def test_partial_fit_oneclass(klass):
14991499
assert clf.coef_.shape == (X.shape[1], )
15001500
assert clf.offset_.shape == (1,)
15011501
assert clf.predict([[0, 0]]).shape == (1, )
1502-
id1 = id(clf.coef_.data)
1502+
previous_coefs = clf.coef_
15031503

15041504
clf.partial_fit(X[third:])
1505-
id2 = id(clf.coef_.data)
15061505
# check that coef_ haven't been re-allocated
1507-
assert id1 == id2
1506+
assert clf.coef_ is previous_coefs
15081507

15091508
# raises ValueError if number of features does not match previous data
15101509
with pytest.raises(ValueError):

0 commit comments

Comments
 (0)