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

Test test_local_gridsearch_aml_logging fails with unexpectd keyword argument iid #166

Open
stijnmoreels opened this issue Jan 14, 2022 · 0 comments
Labels
automated-testing All issues related to the automated testing of the library. good first issue Good for newcomers
Milestone

Comments

@stijnmoreels
Copy link
Member

stijnmoreels commented Jan 14, 2022

Describe the bug
When running the test_local_gridsearch_aml_logging test in the test_tunning_aml.py test file, we get an error saying an unexpected keyword argument iid.

To Reproduce
Run the test.

Expected behavior
Test succeed locally.

Additional context
Current version on master after v1.1.2.1.

./tests/test_tuning_aml.py::test_local_gridsearch_aml_logging Failed: [undefined]TypeError: __init__() got an unexpected keyword argument 'iid'
def test_local_gridsearch_aml_logging():
        if not is_interactive():
            pytest.skip('Test only runs when interactive mode enable')
    
        amlenv = aml.AzureMLEnvironment.Create(config_file='.azureml/config.json')
        trainer = amlenv.start_experiment('arcus-unit-tests')
    
        _run = trainer.new_run('logreg-'+ datetime.now().strftime("%Y%m%d-%H%M%S"))
        df = pd.read_csv('tests/resources/datasets/student-admission.csv')
        y = df.Admission.values
        X = np.asarray(df.drop(['Admission'],axis=1))
        X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.30, random_state=0)
        df.tail(5)
        logreg = linear_model.LogisticRegression(solver='liblinear')
        param_grid = {'C':[0.1,10]}
>       grid = LocalArcusGridSearchCV(logreg, param_grid, scoring='accuracy', active_trainer=trainer)

tests/test_tuning_aml.py:33: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
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 0x7f4ad81bffa0>
estimator = LogisticRegression(solver='liblinear')
param_grid = {'C': [0.1, 10]}

    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 the good first issue Good for newcomers label Jan 14, 2022
@stijnmoreels stijnmoreels added this to the v1.2 milestone Jan 14, 2022
@stijnmoreels stijnmoreels added the automated-testing All issues related to the automated testing of the library. label Jan 14, 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. good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant