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

Version 0.1.4 breaks gam-changer-adult.ipynb notebook #5

Closed
msplants opened this issue Jun 13, 2022 · 2 comments
Closed

Version 0.1.4 breaks gam-changer-adult.ipynb notebook #5

msplants opened this issue Jun 13, 2022 · 2 comments

Comments

@msplants
Copy link

msplants commented Jun 13, 2022

Hello,

There is a check for nans in 0.1.4 (line 268 of gamchanger.py) that breaks on string values. If I use version 0.1.3, the notebook still works. I think columns of string type should be encoded before this check.

Thanks,
Jessica

[/usr/local/lib/python3.7/dist-packages/gamchanger/gamchanger.py](https://localhost:8080/#) in get_sample_data(ebm, x_test, y_test, resort_categorical)
    266 
    267     # Drop all rows with any NA values
--> 268     if np.isnan(x_test_copy).any():
    269         na_row_indexes = np.isnan(x_test_copy).any(axis=1)
    270         x_test_copy = x_test_copy[~na_row_indexes]

TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
xiaohk added a commit that referenced this issue Jun 14, 2022
Signed-off-by: Jay Wang <jay@zijie.wang>
@xiaohk
Copy link
Collaborator

xiaohk commented Jun 14, 2022

Hello Jessica! Thanks for reporting this bug! In 0.1.4, I added code to handle missing value (#4). I should have used pd.isnull() instead of np.isnan(), so that it could work on string values.

45d0d89 and 0.1.5 should fix it. If you have time, can you try version 0.1.5? Thanks!

@msplants
Copy link
Author

Thanks so much @xiaohk! The notebook is working again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants