Comments (15)
Categorical feature indices should be correct. If the 0 and 2 features are categorical and others numeric, then the value should be cat_index=[0,2]
In case of this error some categorical feature was not included to this list, so alrogithm was trying to parse it as numeric.
from catboost.
No, if you provide the date and say that it's a categorical feature, then it will be treated like a string with this value.
from catboost.
@shivamsaboo17, for now if you use python package you should convert the labels to categories or try catboost command line version with option --class-names. Possibility to use class-names in python version will be added soon.
Also automatic setting class_names will be added into both versions.
from catboost.
Does it convert date into numerical value ?
from catboost.
@abaspinar, could you provide your data?
*And check that all features have right indices that you give into cat_features (indices start from 0 (zero))
from catboost.
Thanks! @Donskov7
It was because of wrong indices.
from catboost.
I did'nt understand @abaspinar how did you correct the wrong indicies
from catboost.
I am getting same error but it's with the target labels which are in string format. Should I convert the labels to categories as string labels are not supported?
from catboost.
Same issue
What should i fix if:
I trained catboost and defined cat features as this:
clf.fit(train, labels, cat_dims)
And when i look at indexes of cat and float features in the trained model they are the same as in cat_dims variable before.
I got this error when i load test set and try to make class prediction:
_catboost.CatboostError: Bad value for num_feature[0,3]="1.281.501.0": Cannot convert 'b'1.281.501.0'' to float
My cat indexes in trained model:
[0, 1, 2, 9, 10, 11, 12, 13, 15, 16, 19, 21, 24, 28, 29, 31, 32, 34, 35, 36, 38, 39]
So, Bad value for num_feature[0,3]
error - means, that my third feature was float (and it is true; it is not presented in the cat indexes list above), and it was OK while training, and now, when i try to predict on test sample it suddenly became unable to convert it to float, because third feature in test sample is now categorical (according to the value "1.281.501.0")? And how to know the name of this feature? The "third" feature does not make any sense to me. What should i do to load test samples and make a prediction successfully?
PS.: i open test sample in pandas with the same data types as train. And the number of features is the same
from catboost.
@goshulina Opened #633
from catboost.
for the sake of future visitors - this error is most likely thrown when you have a categorical feature which is not casted to string, prior to fitting
from catboost.
I'm having the same problem on a new dataset. In the coursera example all the column dtypes are int64 and it works fine. Nothing was converted. My new dataset is throwing the error with a float64 that I converted to string (object) and am having the same problem... @annaveronika what am I missing?
from catboost.
do we need to label encode the string containing categorical features which contain dtypes as object to numeric ? for data to be pooled ? because I am also getting same error
TypeError: Cannot convert 'b'W'' to float
from catboost.
I'm having the same problem on a new dataset. In the coursera example all the column dtypes are int64 and it works fine. Nothing was converted. My new dataset is throwing the error with a float64 that I converted to string (object) and am having the same problem... @annaveronika what am I missing?
It is not allowed to use floating point columns for categorical features. The best thing is to use Categorical type, you can also use integer or object types.
Here is the explanation why you cannot use float numbers for categorical features:
https://catboost.ai/docs/concepts/faq.html#specify-weights-or-baseline-for-eval-set
from catboost.
do we need to label encode the string containing categorical features which contain dtypes as object to numeric ? for data to be pooled ? because I am also getting same error
TypeError: Cannot convert 'b'W'' to float
This error means that you have not listed your categorical feature in cat_features parameter. By default all features are considered numeric. You must explicitly say that the feature is categorical.
from catboost.
Related Issues (20)
- How to recursive remove features by best loss ? HOT 2
- Issue with Categorical Feature Encoding in Binary Classification HOT 1
- Request to enable sample weights for Cox and AFT objectives HOT 1
- C++ standalone evaluator multiclass support HOT 1
- The results calculated according to the formula described in the doc are different from the results displayed by the model.
- Documentation: broken links HOT 1
- SetPredictionType(modelHandle, APT_CLASS) is broken HOT 1
- Where is the place for calculating the score function? HOT 2
- Build catboost python package with custom glibc HOT 3
- Custom RMSE loss in tutorial get difference tree structure with the original RMSE loss!!! HOT 3
- Tensor Search Helpers Should Be Unreachable HOT 8
- _catboost.CatBoostError: /src/catboost/catboost/libs/model/model.cpp:564: Too many features in model, ask catboost team for support HOT 3
- If multiple GPUs are present at server and devices parameter is set to specific GPU, catboost allocates GPU memory at other GPUs HOT 1
- Different results with Python and command line HOT 1
- PySpark ML CrossValidator cannot load serialized CrossValidator because it cannot find CatBoostRegressor class HOT 1
- CatBoost for Apache Spark AUC eval metric not working as expected. HOT 3
- CatBoost throws an exception when dealing with a large dataset
- Catboost 1.2.5 broke text features on GPU "Can't find borders for feature #4138" HOT 3
- R: Failed to install 'unknown package' from GitHub HOT 2
- [Model dump: JSON] model.save_model does not warn when required "pool" argument is skipped
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from catboost.