GNU bug report logs - #37433
python-scikit-learn has two failing tests

Previous Next

Package: guix;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Mon, 16 Sep 2019 22:47:02 UTC

Severity: normal

Done: Jesse Gibbons <jgibbons2357 <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 37433 in the body.
You can then email your comments to 37433 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#37433; Package guix. (Mon, 16 Sep 2019 22:47:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ricardo Wurmus <rekado <at> elephly.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 16 Sep 2019 22:47:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: bug-guix <at> gnu.org
Cc: "Lindberg, Eric Lars-Helge" <Eric.Lindberg <at> mdc-berlin.de>
Subject: python-scikit-learn has two failing tests
Date: Tue, 17 Sep 2019 00:46:01 +0200
The python-scikit-learn package fails to build due to two failing tests:

--8<---------------cut here---------------start------------->8---
=================================== FAILURES ===================================
___________________________ test_scale_and_stability ___________________________

    def test_scale_and_stability():
        # We test scale=True parameter
        # This allows to check numerical stability over platforms as well
    
        d = load_linnerud()
        X1 = d.data
        Y1 = d.target
        # causes X[:, -1].std() to be zero
        X1[:, -1] = 1.0
    
        # From bug #2821
        # Test with X2, T2 s.t. clf.x_score[:, 1] == 0, clf.y_score[:, 1] == 0
        # This test robustness of algorithm when dealing with value close to 0
        X2 = np.array([[0., 0., 1.],
                       [1., 0., 0.],
                       [2., 2., 2.],
                       [3., 5., 4.]])
        Y2 = np.array([[0.1, -0.2],
                       [0.9, 1.1],
                       [6.2, 5.9],
                       [11.9, 12.3]])
    
        for (X, Y) in [(X1, Y1), (X2, Y2)]:
            X_std = X.std(axis=0, ddof=1)
            X_std[X_std == 0] = 1
            Y_std = Y.std(axis=0, ddof=1)
            Y_std[Y_std == 0] = 1
    
            X_s = (X - X.mean(axis=0)) / X_std
            Y_s = (Y - Y.mean(axis=0)) / Y_std
    
            for clf in [CCA(), pls_.PLSCanonical(), pls_.PLSRegression(),
                        pls_.PLSSVD()]:
                clf.set_params(scale=True)
                X_score, Y_score = clf.fit_transform(X, Y)
                clf.set_params(scale=False)
                X_s_score, Y_s_score = clf.fit_transform(X_s, Y_s)
                assert_array_almost_equal(X_s_score, X_score)
                assert_array_almost_equal(Y_s_score, Y_score)
                # Scaling should be idempotent
                clf.set_params(scale=True)
                X_score, Y_score = clf.fit_transform(X_s, Y_s)
>               assert_array_almost_equal(X_s_score, X_score)
E               AssertionError: 
E               Arrays are not almost equal to 6 decimals
E               
E               (mismatch 50.0%)
E                x: array([-1.337317, -0.041705, -1.108472,  0.098154,  0.407632, -0.103084,
E                       2.038158,  0.046634])
E                y: array([-1.337317, -0.041776, -1.108472,  0.0982  ,  0.407632, -0.103027,
E                       2.038158,  0.046602])

sklearn/cross_decomposition/tests/test_pls.py:365: AssertionError
____________________________ test_unsorted_indices _____________________________

    def test_unsorted_indices():
        # test that the result with sorted and unsorted indices in csr is the same
        # we use a subset of digits as iris, blobs or make_classification didn't
        # show the problem
        digits = load_digits()
        X, y = digits.data[:50], digits.target[:50]
        X_test = sparse.csr_matrix(digits.data[50:100])
    
        X_sparse = sparse.csr_matrix(X)
        coef_dense = svm.SVC(kernel='linear', probability=True,
                             random_state=0).fit(X, y).coef_
        sparse_svc = svm.SVC(kernel='linear', probability=True,
                             random_state=0).fit(X_sparse, y)
        coef_sorted = sparse_svc.coef_
        # make sure dense and sparse SVM give the same result
        assert_array_almost_equal(coef_dense, coef_sorted.toarray())
    
        X_sparse_unsorted = X_sparse[np.arange(X.shape[0])]
        X_test_unsorted = X_test[np.arange(X_test.shape[0])]
    
        # make sure we scramble the indices
>       assert_false(X_sparse_unsorted.has_sorted_indices)

sklearn/svm/tests/test_sparse.py:118: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <sklearn.utils._unittest_backport.TestCase testMethod=__init__>, expr = 1
msg = '1 is not false'

    def assertFalse(self, expr, msg=None):
        """Check that the expression is false."""
        if expr:
            msg = self._formatMessage(msg, "%s is not false" % safe_repr(expr))
>           raise self.failureException(msg)
E           AssertionError: 1 is not false

/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/lib/python3.7/unittest/case.py:686: AssertionError
[…]
2 failed, 10415 passed, 30 skipped, 1 deselected, 1 xfailed, 1026 warnings in 895.50 seconds 
--8<---------------cut here---------------end--------------->8---

-- 
Ricardo





Information forwarded to bug-guix <at> gnu.org:
bug#37433; Package guix. (Fri, 11 Oct 2019 19:28:02 GMT) Full text and rfc822 format available.

Message #8 received at 37433 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Jesse Gibbons <jgibbons2357 <at> gmail.com>
Cc: 37433 <at> debbugs.gnu.org, 37705 <at> debbugs.gnu.org
Subject: Re: bug#37705: python-scikit-learn fails tests
Date: Fri, 11 Oct 2019 21:27:26 +0200
Jesse Gibbons <jgibbons2357 <at> gmail.com> writes:

> I need python-scikit-learn for an ai project.
>
> "guix build python-scikit-learn"
> ...
> build of /gnu/store/wymxdfygbzij8hbz4gqkrwnb3jkicx76-python-scikit-learn-
> 0.20.3.drv failed
> View build log at '/var/log/guix/drvs/wy/mxdfygbzij8hbz4gqkrwnb3jkicx76-
> python-scikit-learn-0.20.3.drv.bz2'.
>
>
> log tarball attached.
>
> I'm working on fixing it, but help would be appreciated.

This is a duplicate of bug 37433.

-- 
Ricardo





Information forwarded to bug-guix <at> gnu.org:
bug#37433; Package guix. (Fri, 11 Oct 2019 19:49:01 GMT) Full text and rfc822 format available.

Message #11 received at 37433 <at> debbugs.gnu.org (full text, mbox):

From: Jesse Gibbons <jgibbons2357 <at> gmail.com>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 37433 <at> debbugs.gnu.org, 37705 <at> debbugs.gnu.org
Subject: Re: bug#37433: bug#37705: python-scikit-learn fails tests
Date: Fri, 11 Oct 2019 13:48:40 -0600
On Fri, 2019-10-11 at 21:27 +0200, Ricardo Wurmus wrote:
> Jesse Gibbons <jgibbons2357 <at> gmail.com> writes:
> 
> > I need python-scikit-learn for an ai project.
> > 
> > "guix build python-scikit-learn"
> > ...
> > build of /gnu/store/wymxdfygbzij8hbz4gqkrwnb3jkicx76-python-scikit-
> > learn-
> > 0.20.3.drv failed
> > View build log at '/var/log/guix/drvs/wy/mxdfygbzij8hbz4gqkrwnb3jkicx76-
> > python-scikit-learn-0.20.3.drv.bz2'.
> > 
> > 
> > log tarball attached.
> > 
> > I'm working on fixing it, but help would be appreciated.
> 
> This is a duplicate of bug 37433.
> 
Ok.
I sent patch #37707 to fix it.





Reply sent to Jesse Gibbons <jgibbons2357 <at> gmail.com>:
You have taken responsibility. (Sat, 12 Oct 2019 15:09:02 GMT) Full text and rfc822 format available.

Notification sent to Ricardo Wurmus <rekado <at> elephly.net>:
bug acknowledged by developer. (Sat, 12 Oct 2019 15:09:02 GMT) Full text and rfc822 format available.

Message #16 received at 37433-done <at> debbugs.gnu.org (full text, mbox):

From: Jesse Gibbons <jgibbons2357 <at> gmail.com>
Cc: 37433-done <at> debbugs.gnu.org
Subject: 37433 fixed
Date: Sat, 12 Oct 2019 09:07:58 -0600
On Fri, 2019-10-11 at 13:48 -0600, Jesse Gibbons wrote:
> On Fri, 2019-10-11 at 21:27 +0200, Ricardo Wurmus wrote:
> > Jesse Gibbons <jgibbons2357 <at> gmail.com> writes:
> > 
> > > I need python-scikit-learn for an ai project.
> > > 
> > > "guix build python-scikit-learn"
> > > ...
> > > build of /gnu/store/wymxdfygbzij8hbz4gqkrwnb3jkicx76-python-scikit-
> > > learn-
> > > 0.20.3.drv failed
> > > View build log at
> > > '/var/log/guix/drvs/wy/mxdfygbzij8hbz4gqkrwnb3jkicx76-
> > > python-scikit-learn-0.20.3.drv.bz2'.
> > > 
> > > 
> > > log tarball attached.
> > > 
> > > I'm working on fixing it, but help would be appreciated.
> > 
> > This is a duplicate of bug 37433.
> I sent patch #37707 to fix it.
> 
> 
> 
Fixed in patch d7e29a2b26
-- 
-Jesse





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 10 Nov 2019 12:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.