Hi <#C032L838318|mlforecast>, I am new to mlforeca...
# mlforecast
r
Hi #mlforecast, I am new to mlforecast and trying to get feature importance for LGBM model in mlforecast but cant find any documentation. The code looks like this. Has anyone done like this before ? fcst = MLForecast( models=[ lgb.LGBMRegressor(**model_params)], #xgb.XGBRegressor(**model_params)], freq='M', # include 6 monthly lags lags=[1,2,3,4,5,6], # create a feature for year and month date_features=['year','month'], lag_transforms={ 1: [expanding_mean, # add 1 period lag for the mean (expanding over the window) (rolling_mean,3), # add 1 period lag for 3 month rolling mean (rolling_mean,6), # add 1 period lag for 6 month rolling mean ] }, target_transforms=[StandardScaler()], # transform to z-score normalized )
j
Hi. After you fit the models they're available on the
MLForecast.models_
dict, so in your particular example I believe you can use
fcst.models_['LGBMRegressor']
and can access the attributes like feature importance
r
thanks - is this library a wrapper around sklearn library ?
j
It leverages the sklearn api to train the models and compute predictions
r
thank you @José Morales 🙂 for your quick messages and support