Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Test test_classification_evaluation_keras_gridsearch fails with unexpected keyword argument iid #168

Open
stijnmoreels opened this issue Jan 21, 2022 · 0 comments
Labels
automated-testing All issues related to the automated testing of the library. bug Something isn't working
Milestone

Comments

@stijnmoreels
Copy link
Member

stijnmoreels commented Jan 21, 2022

Describe the bug
The test_classification_evaluation_keras_gridsearch test fails locally with an unexpected keyword argument iid.

To Reproduce
Run the test locally.

Expected behavior
The test succeeds.

Additional context
Current version on master after v1.1.2.1.

./tests/test_workenvironment_aml.py::test_classification_evaluation_keras_gridsearch Failed: [undefined]TypeError: __init__() got an unexpected keyword argument 'iid'
def test_classification_evaluation_keras_gridsearch():
        if not is_interactive():
            pytest.skip('Test only runs when interactive mode enable')
    
        df = pd.read_csv('tests/resources/datasets/student-admission.csv')
        y = df.pop('Admission')
        X = np.asarray(df)
        X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30, random_state=0)
        y_train = np_utils.to_categorical(y_train)
    
    
        amlenv = fac.Create(connected = True, config_file='.azureml/config.json')
        trainer = amlenv.start_experiment('arcus-unit-tests')
        _run = trainer.new_run('neuralnet')
        model = KerasClassifier(build_fn=build_sequential_model, batch_size=16, epochs =4)
        param_grid = {'neurons':[5]}
>       grid = LocalArcusGridSearchCV(estimator=model, param_grid = param_grid,verbose=3, active_trainer=trainer)

tests/test_workenvironment_aml.py:164: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
arcus/azureml/experimenting/tuning.py:219: in __init__
    super().__init__(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <[AttributeError("'LocalArcusGridSearchCV' object has no attribute 'active_trainer'") raised in repr()] LocalArcusGridSearchCV object at 0x7f1a74c9d820>
estimator = <keras.wrappers.scikit_learn.KerasClassifier object at 0x7f19e7104f40>
param_grid = {'neurons': [5]}

    def __init__(self, estimator, param_grid, *, scoring=None,
                 n_jobs=None, iid='deprecated', refit=True, cv=None,
                 verbose=0, pre_dispatch='2*n_jobs',
                 error_score=np.nan, return_train_score=False):
>       super().__init__(
            estimator=estimator, scoring=scoring,
            n_jobs=n_jobs, iid=iid, refit=refit, cv=cv, verbose=verbose,
            pre_dispatch=pre_dispatch, error_score=error_score,
            return_train_score=return_train_score)
E       TypeError: __init__() got an unexpected keyword argument 'iid'

arcus/azureml/experimenting/tuning.py:24: TypeError
@stijnmoreels stijnmoreels added bug Something isn't working automated-testing All issues related to the automated testing of the library. labels Jan 21, 2022
@stijnmoreels stijnmoreels added this to the v1.2 milestone Jan 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automated-testing All issues related to the automated testing of the library. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant