Bug#1078123: scikit-learn: test_svm fails on i386 with scipy 1.13

Drew Parsons dparsons at debian.org
Wed Aug 7 09:41:29 BST 2024


Source: scikit-learn
Version: 1.4.2+dfsg-5
Severity: normal
Control: forwarded -1 https://github.com/scikit-learn/scikit-learn/issues/29633

scipy 1.13 is triggering test failure in
test_svc_ovr_tie_breaking[NuSVC] on i386 architecture.

The error can be seeing in debian CI tests, https://ci.debian.net/packages/s/scikit-learn/unstable/i386/
Full test log at https://ci.debian.net/packages/s/scikit-learn/unstable/i386/50043538/
or https://ci.debian.net/packages/s/scikit-learn/testing/i386/50043537/


1333s _______________________ test_svc_ovr_tie_breaking[NuSVC] _______________________
1333s 
1333s SVCClass = <class 'sklearn.svm._classes.NuSVC'>
1333s 
1333s     @pytest.mark.parametrize("SVCClass", [svm.SVC, svm.NuSVC])
1333s     def test_svc_ovr_tie_breaking(SVCClass):
1333s         """Test if predict breaks ties in OVR mode.
1333s         Related issue: https://github.com/scikit-learn/scikit-learn/issues/8277
1333s         """
1333s         X, y = make_blobs(random_state=0, n_samples=20, n_features=2)
1333s     
1333s         xs = np.linspace(X[:, 0].min(), X[:, 0].max(), 100)
1333s         ys = np.linspace(X[:, 1].min(), X[:, 1].max(), 100)
1333s         xx, yy = np.meshgrid(xs, ys)
1333s     
1333s         common_params = dict(
1333s             kernel="rbf", gamma=1e6, random_state=42, decision_function_shape="ovr"
1333s         )
1333s         svm = SVCClass(
1333s             break_ties=False,
1333s             **common_params,
1333s         ).fit(X, y)
1333s         pred = svm.predict(np.c_[xx.ravel(), yy.ravel()])
1333s         dv = svm.decision_function(np.c_[xx.ravel(), yy.ravel()])
1333s >       assert not np.all(pred == np.argmax(dv, axis=1))
1333s E       assert not True
1333s E        +  where True = <function all at 0xf689d5e0>(array([1, 1, 1, ..., 1, 1, 1]) == array([1, 1, ..., dtype=int32)
1333s E        +    where <function all at 0xf689d5e0> = np.all
1333s E           
1333s E           Full diff:
1333s E           - array([1, 1, 1, ..., 1, 1, 1], dtype=int32)
1333s E           ?                              -------------
1333s E           + array([1, 1, 1, ..., 1, 1, 1]))
1333s 
1333s /usr/lib/python3/dist-packages/sklearn/svm/tests/test_svm.py:1225: AssertionError


I'll add a patch to skip it in the meantime while upstream is
reworking the test.



More information about the debian-science-maintainers mailing list