catboost.CatBoostError: Invalid type for cat_feature[non-default value idx=14616,feature_idx=21]=nan : cat_features must be integer or string, real number values and NaN values should be converted to string.
Traceback (most recent call last):
File "controller.py", line 167, in
execute_model_train(datapath, modelname, predictors, cat_cols, target_col, usetimeseries=False) # Run the function to build the model
File "/home/acharya/PycharmProjects/dream11/main.py", line 76, in execute_model_train
modelobjects = modeltrain.train_model(model=modelname)
File "/home/acharya/PycharmProjects/dream11/point_prediction.py", line 168, in train_model
model_grid.fit(X, y, eval_set=(X_test, y_test))
File "/home/acharya/.local/lib/python3.6/site-packages/sklearn/utils/validation.py", line 63, in inner_f
return f(*args, kwargs)
File "/home/acharya/.local/lib/python3.6/site-packages/sklearn/model_selection/_search.py", line 880, in fit
self.bestestimator.fit(X, y, fit_params)
File "/home/acharya/.local/lib/python3.6/site-packages/catboost/core.py", line 5261, in fit
save_snapshot, snapshot_file, snapshot_interval, init_model, callbacks, log_cout, log_cerr)
File "/home/acharya/.local/lib/python3.6/site-packages/catboost/core.py", line 1989, in _fit
callbacks=callbacks
File "/home/acharya/.local/lib/python3.6/site-packages/catboost/core.py", line 1869, in _prepare_train_params
baseline, column_description)
File "/home/acharya/.local/lib/python3.6/site-packages/catboost/core.py", line 1154, in _build_train_pool
group_weight=group_weight, subgroup_id=subgroup_id, pairs_weight=pairs_weight, baseline=baseline)
File "/home/acharya/.local/lib/python3.6/site-packages/catboost/core.py", line 619, in init
self._init(data, label, cat_features, text_features, embedding_features, pairs, weight, group_id, group_weight, subgroup_id, pairs_weight, baseline, feature_names, thread_count)
File "/home/acharya/.local/lib/python3.6/site-packages/catboost/core.py", line 1135, in _init
self._init_pool(data, label, cat_features, text_features, embedding_features, pairs, weight, group_id, group_weight, subgroup_id, pairs_weight, baseline, feature_names, thread_count)
File "_catboost.pyx", line 3723, in _catboost._PoolBase._init_pool
File "_catboost.pyx", line 3770, in _catboost._PoolBase._init_pool
File "_catboost.pyx", line 3611, in _catboost._PoolBase._init_features_order_layout_pool
File "_catboost.pyx", line 2619, in _catboost._set_features_order_data_pd_data_frame
File "_catboost.pyx", line 2219, in _catboost.get_cat_factor_bytes_representation
_catboost.CatBoostError: Invalid type for cat_feature[non-default value idx=14616,feature_idx=21]=nan : cat_features must be integer or string, real number values and NaN values should be converted to string.
achar
catboost.CatBoostError: Invalid type for cat_feature[non-default value idx=14616,feature_idx=21]=nan : cat_features must be integer or string, real number values and NaN values should be converted to string.