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
Exception: TypeError: a float is required #958
Comments
After further debugging, and updating my scripts and notebook to Python 3.7, I can confirm this bug happens only with Python 2. So this is a Python version specific bug. On Python 3.7, CatBoost can handle categorical features without any prior encoding, but for Python 2.7 there should at least be a warning that categorical features should be encoded, in case this bug cannot be fixed. |
What is surprising is that with the titanic dataset provided in catboost, there is no issue even without any prior encoding in Python 2.7. Ah also I found that my columns here had some |
Can you please try with the latest version? We've made changes to this part of the code and the bug should be fixed. |
I hope it has helped! Let us know if you still have problems, I'll reopen the issue! |
I keep getting the same issue. I made sure I am using the Python 3.7 and also that the Catboost package is updated and I am still getting the error: CatBoostError: Bad value for num_feature[non_default_doc_idx=0,feature_idx=11]="['5']": Cannot convert 'b"['5']"' to float I also made sure I'm passing the right index for the categorical feature:
|
catboost version: 0.16.4
Operating System: Windows 10 64-bits
CPU: Intel Core i7 8th Gen
Python 2.7
Problem:
When I try to fit a simple CatBoostClassifier on my DataFrame containing categorical variables, I get the very cryptic error below.
Here is what I did to try to troubleshoot down the issue:
I can't understand what's happening here and have no idea on how to debug this further. If anyone has any idea, please let me know, I can provide more info.
Here is the code failing (it's not a minimal example, I'm not sure how I can reproduce this):
And the error traceback:
The text was updated successfully, but these errors were encountered: