Skip to content
Advertisement

Optuna lightgbm integration giving categorical features error

Im creating a model using optuna lightgbm integration, My training set has some categorical features and i pass those features to the model using the lgb.Dataset class, here is the code im using ( NOTE: X_train, X_val, y_train, y_val are all pandas dataframes ).

JavaScript

Every time the lgb.train function is called, i get the following user warning

JavaScript

I believe that lighgbm is not treating my categorical features the way it should, someone knows how to fix this issue? Am i using the parameter correctly?

Advertisement

Answer

In case of picking the name (not indexes) of those columns, add as well the feature_name parameters as the documentation states

That said, your dval and dtrain will be initialized as follow:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement