Thanks to visit codestin.com
Credit goes to github.com

Skip to content

failed test_ard_accuracy_on_easy_problem using specific seed #15420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kwenlyou opened this issue Oct 31, 2019 · 4 comments
Closed

failed test_ard_accuracy_on_easy_problem using specific seed #15420

kwenlyou opened this issue Oct 31, 2019 · 4 comments
Milestone

Comments

@kwenlyou
Copy link

kwenlyou commented Oct 31, 2019

Description

the test failed using seed=45, however, it will pass if other seeds are used such as 46 or 47

Steps/Code to Reproduce

    def test_ard_accuracy_on_easy_problem():
        # Check that ARD converges with reasonable accuracy on an easy problem
        # (Github issue #14055)
        # This particular seed seems to converge poorly in the failure-case
        # (scipy==1.3.0, sklearn==0.21.2)
        seed = 45
        X = np.random.RandomState(seed=seed).normal(size=(250, 3))
        y = X[:, 1]

        regressor = ARDRegression()
        regressor.fit(X, y)

        abs_coef_error = np.abs(1 - regressor.coef_[1])
        # Expect an accuracy of better than 1E-4 in most cases -
        # Failure-case produces 0.16!
>       assert abs_coef_error < 0.0
E       assert 1.2070270934527727e-05 < 0.0

-->

Expected Results

pass

Actual Results

asser error

Versions

System:
    python: 3.6.8 (default, Oct  7 2019, 12:59:55)  [GCC 8.3.0]
executable: /usr/local/bin/python
   machine: Linux-4.15.0-1039-aws-x86_64-with-Ubuntu-18.04-bionic

Python deps:
       pip: 19.3.1
setuptools: 41.6.0
   sklearn: 0.22.dev0
     numpy: 1.17.3
     scipy: 1.3.1
    Cython: 0.29.13
    pandas: 0.25.2
matplotlib: 3.1.1
    joblib: 0.14.0
@jnothman
Copy link
Member

jnothman commented Oct 31, 2019 via email

@kwenlyou
Copy link
Author

kwenlyou commented Nov 1, 2019

@jnothman what I mean is seed=45 can cause a failure on some flatform such as mine but it succeeds on others such as https://travis-ci.org/scikit-learn/scikit-learn

@adrinjalali
Copy link
Member

Does #16849 also fix this one @NicolasHug ?

@NicolasHug
Copy link
Member

Yeah the test works just fine on seed=range(100) now

Thanks for the notice @adrinjalali

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants