0

I have sample data in following format enter image description hereand I am trying to run Holts model on it to forecast ln_value for future 10 time points for each groupby variable 'bid'. I am running following snippet but I am unable to store the forecast in a dataframe. Can someone please help on how to do it? Thanks

def triple_smoothing(g): print(f'Creating model for: {g.bid.iloc[0]}')

model = ExponentialSmoothing(g['ln_val'],trend='add', seasonal=None, damped_trend=True)

fit = model.fit()
fit.summary()
# Forecast
prediction_size = 10
forecast_values = fit.forecast(prediction_size)
print(forecast_values)
print()

df.groupby('bid').apply(triple_smoothing)

enter image description here is what I am expecting in the dataframe

Shash
  • 1
  • 1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Aug 29 '23 at 01:05

0 Answers0