Y-oHr-N / OptGBM

Optuna + LightGBM = OptGBM
MIT License
34 stars 7 forks source link

test_fit_with_empty_param_distributions raises AssertionError #91

Open Y-oHr-N opened 4 years ago

Y-oHr-N commented 4 years ago
tmp_path = PosixPath('/tmp/pytest-of-root/pytest-0/test_fit_with_empty_param_dist0')

    def test_fit_with_empty_param_distributions(tmp_path: pathlib.Path) -> None:
        X, y = load_breast_cancer(return_X_y=True)

        clf = OGBMClassifier(
            colsample_bytree=0.1,
            n_estimators=n_estimators,
            n_trials=n_trials,
            param_distributions={},
            train_dir=tmp_path,
        )

        clf.fit(X, y)

        df = clf.study_.trials_dataframe()
        values = df["value"]

>       assert values.nunique() == 1
E       assert 2 == 1
E        +  where 2 = <bound method IndexOpsMixin.nunique of 0    0.302962\n1    0.302962\n2    0.302962\n3    0.302962\n4    0.302962\nName: value, dtype: float64>()
E        +    where <bound method IndexOpsMixin.nunique of 0    0.302962\n1    0.302962\n2    0.302962\n3    0.302962\n4    0.302962\nName: value, dtype: float64> = 0    0.302962\n1    0.302962\n2    0.302962\n3    0.302962\n4    0.302962\nName: value, dtype: float64.nunique

tests/test_sklearn.py:182: AssertionError