https://github.com/nixtla logo
#mlforecast
Title
# mlforecast
m

Mike C

08/04/2023, 8:50 PM
Hello, is there a way to pass in categorical features to LightGBM through
fcst.fit(...)
? I could be way off, but it seems like using
date_features
does label encoding but then these are treated as numeric features in the model itself (or maybe that is by design?). Also, trying to specify the cat indexes in the constructor for LGBMRegression provides the following:
Copy code
UserWarning: categorical_feature keyword has been found in `params` and will be ignored.
Please use categorical_feature argument of the Dataset constructor to pass this parameter.
Thanks!
j

José Morales

08/04/2023, 9:10 PM
Hey. You can compute the features with preprocess, manually train the model and then use it to compute predictions like here or you could also leverage the fact that lightgbm automatically uses columns with categorical data type as categorical features using a pipeline like here.
m

Mike C

08/04/2023, 9:49 PM
Perfect, thank you!