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

predict_qd raises ValueError: invalid literal for int() with base 10 #40

Closed
smarie opened this issue Mar 16, 2023 · 1 comment · Fixed by #41
Closed

predict_qd raises ValueError: invalid literal for int() with base 10 #40

smarie opened this issue Mar 16, 2023 · 1 comment · Fixed by #41

Comments

@smarie
Copy link
Contributor

smarie commented Mar 16, 2023

This bug happens when one column starts with a nan, and then contains a string. Numpy vectorize is guessing from nan that the mapping operation creates a number, but then it fails when it hits a string.

@smarie smarie changed the title ValueError: invalid literal for int() with base 10 predict_qd raises ValueError: invalid literal for int() with base 10 Mar 16, 2023
@smarie
Copy link
Contributor Author

smarie commented Mar 16, 2023

df = pd.DataFrame({
    "foo": ["1", "2"],
    "bar": [np.nan, "B"]
})
qd_forest = qd_screen(df)
feat_selector = qd_forest.fit_selector_model(df)
only_important_features_df = feat_selector.remove_qd(df)
result = feat_selector.predict_qd(only_important_features_df)

smarie pushed a commit that referenced this issue Mar 16, 2023
…t_qd`. Fixed #40

Replaced usage of deprecated `scipy_mode`. Fixed  #39
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

Successfully merging a pull request may close this issue.

1 participant