hey everyone, I'm trying to fit a LGBMRegressor wi...
# mlforecast
a
hey everyone, I'm trying to fit a LGBMRegressor with tweedie objective. The input data is of weekly sales in mlforecast format - unique_id, ds, y. Below are the features that I'm using but the prediction is always coming out to be the averaged value. Please suggest what set of features should I try here?
fcst = MLForecast(models=[LGBMRegressor(model params here)],
freq='W-Sun',
date_features=['week', 'month', 'quarter', 'year'],
lags=[1, 4, 8, 12, 52],
lag_transforms={
1: [(rolling_mean,4), (rolling_min, 4), (rolling_max, 4), (rolling_std , 4),
(rolling_mean, 8), (rolling_min,8) ,(rolling_max, 8), (rolling_std, 8),
(seasonal_rolling_mean, 12, 4),(seasonal_rolling_min, 12, 4),(seasonal_rolling_max, 12, 4),
],
},
)
Below is the plot which shows all the predictions are same. But it seems that there is a pattern in the data.
j
Try setting
dropna=False
in the fit call, those lag transformations will produce many NaNs and the model will be left too few samples (you can see that by running preprocess first)
a
Thanks José. Comparatively better than before but still the error is high. Based on my limited understanding, I provided week, moth, lag 52 & some rolling means. But the fit is still not that good. Any suggestions on the features side as what features should I use given the plot?
j
Is that your only serie or is that a sample? If you don't have that many observations try removing the features that require a lot of samples (seasonal rolling) and setting min_samples=1 for the rest.