Skip to content

Instantly share code, notes, and snippets.

@jetnew
Created June 1, 2019 16:32
Show Gist options
  • Save jetnew/25370668843d15f589c6981adf25abab to your computer and use it in GitHub Desktop.
Save jetnew/25370668843d15f589c6981adf25abab to your computer and use it in GitHub Desktop.
Holt Winters additive using statsmodels
from statsmodels.tsa.holtwinters import ExponentialSmoothing
fit = ExponentialSmoothing(data, seasonal_periods=periodicity, trend='add', seasonal='add').fit(use_boxcox=True)
fit.fittedvalues.plot(color='blue')
fit.forecast(5).plot(color='green')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment