I have a dataset (pandas data frame) with all features of type int32 containing continuous values except one feature state_number
, its data type is int32, but it represents different states of a network (category). The feature state_number
has 11 unique values. I want to train a cat boost model on this dataset; how can I specify in cat boost to treat it as a category even though it looks like a number? So far I have tried these steps:
Type cast
state_number
to category type for both train and test data.X_train_['state_number'] = X_train_['state_number'].astype("category")
While training cat boost, I specified the
state_number
in thecat_feature
parameter.model_catBoost.fit(X_train, y_train ,cat_features = ['state_number'])
Is this approach correct, or am I adding some bias or doing something wrong?