Skip to content
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

test_fit_twice_without_study raises AssertionError #92

Open
Y-oHr-N opened this issue Jul 25, 2020 · 0 comments
Open

test_fit_twice_without_study raises AssertionError #92

Y-oHr-N opened this issue Jul 25, 2020 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@Y-oHr-N
Copy link
Owner

Y-oHr-N commented Jul 25, 2020

tmp_path = PosixPath('/tmp/pytest-of-root/pytest-6/test_fit_twice_without_study__0'), n_jobs = -1

    @pytest.mark.parametrize("n_jobs", [-1, 1])
    def test_fit_twice_without_study(tmp_path: pathlib.Path, n_jobs: int) -> None:
        X, y = load_breast_cancer(return_X_y=True)
    
        clf = OGBMClassifier(
            n_estimators=n_estimators,
            n_jobs=n_jobs,
            n_trials=n_trials,
            random_state=random_state,
            train_dir=tmp_path,
        )
    
        clf.fit(X, y)
    
        df = clf.study_.trials_dataframe()
        values = df["value"]
    
        clf = OGBMClassifier(
            bagging_fraction=1.0,
            bagging_freq=0,
            feature_fraction=1.0,
            lambda_l1=0.0,
            lambda_l2=0.0,
            min_data_in_leaf=20,
            n_estimators=n_estimators,
            n_jobs=n_jobs,
            n_trials=n_trials,
            random_state=random_state,
            train_dir=tmp_path,
        )
    
        clf.fit(X, y)
    
        df = clf.study_.trials_dataframe()
    
>       np.testing.assert_array_equal(values, df["value"])
E       AssertionError: 
E       Arrays are not equal
E       
E       Mismatched elements: 1 / 5 (20%)
E       Max absolute difference: 5.55111512e-17
E       Max relative difference: 1.84773566e-16
E        x: array([0.690443, 0.315822, 0.300428, 0.690443, 0.308651])
E        y: array([0.690443, 0.315822, 0.300428, 0.690443, 0.308651])

tests/test_sklearn.py:289: AssertionError
@Y-oHr-N Y-oHr-N added the bug Something isn't working label Jul 25, 2020
@Y-oHr-N Y-oHr-N added this to the 1.0.0 milestone Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant