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

UnboundLocalError: local variable 'params' referenced before assignment #16

Closed
Benno26 opened this issue Jan 27, 2022 · 4 comments
Closed

Comments

@Benno26
Copy link

Benno26 commented Jan 27, 2022

/opt/conda/lib/python3.7/site-packages/featurewiz/featurewiz.py in featurewiz(dataname, target, corr_limit, verbose, sep, header, test_data, feature_engg, category_encoders, dask_xgboost_flag, nrows, **kwargs)
1130 param['nthread'] = -1
1131 param['tree_method'] = 'gpu_hist'
-> 1132 params['eta'] = 0.01
1133 params['subsample'] = 0.5
1134 params['grow_policy'] = 'depthwise' # 'lossguide' #

Is params getting set here instead of param? https://github.com/AutoViML/featurewiz/blob/main/featurewiz/featurewiz.py

@AutoViML
Copy link
Owner

Hi @Benno26 👍
You found a typo. I fixed it. Just upgrade to version 0.0.85 via:

pip install featurewiz --upgrade

Confirm it by closing this bug.
Thx
AutoViML

@Benno26
Copy link
Author

Benno26 commented Jan 27, 2022

Thought as much, thanks for the quick fix :)

@AutoViML
Copy link
Owner

Fixed. Closed

@a-schot
Copy link
Contributor

a-schot commented May 15, 2023

This issue returned. I tried version 0.3.0 and 0.3.1

UnboundLocalError                         Traceback (most recent call last)
[<ipython-input-7-5c3d00237eee>](https://localhost:8080/#) in <cell line: 1>()
----> 1 X_train_selected = fwiz.fit_transform(X_train, pd.Series(y_train, name="status_group"))
      2 X_test_selected = fwiz.transform(X_test)
      3 ### get list of selected features ###
      4 fwiz.features

3 frames
[/usr/local/lib/python3.10/dist-packages/featurewiz/featurewiz.py](https://localhost:8080/#) in featurewiz(dataname, target, corr_limit, verbose, sep, header, test_data, feature_engg, category_encoders, dask_xgboost_flag, nrows, skip_sulov, **kwargs)
    758         param['nthread'] = -1
    759         param['tree_method'] = 'gpu_hist'
--> 760         params['eta'] = 0.01
    761         params['subsample'] = 0.5
    762         params['grow_policy'] = 'depthwise' # 'lossguide' #

UnboundLocalError: local variable 'params' referenced before assignment

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

3 participants