from statsmodels.tsa.api import ExponentialSmoothing, SimpleExpSmoothing, Holt
fit1 = SimpleExpSmoothing(train_df).fit(smoothing_level=0.2,optimized=False)
fcast1 = fit1.forecast(4).rename(r'$\alpha=0.2$')
fcast1.plot(marker='o', color='blue', legend=True)
fit1.fittedvalues.plot(marker='o', color='blue')
My dataframe, train_df has two columns, first column with stock value price, second column serial number(like 1,2,3...)
Here i am trying to forecast those values of stock using exponential smoothing
This is the error
NotImplementedError: Only 1 dimensional data supported
It would be best if you could give a data example. Nevertheless, I created a small data example myself.
The following creates a DataFrame as you describe:
You need however as input a
pd.Series
of Stock:Last, you put in
train_ps
into your model: