Skip to content

Instantly share code, notes, and snippets.

@lylayang
Created March 23, 2020 04:06
Show Gist options
  • Save lylayang/d0b55bed7581fe8623f6ddde29ceb53d to your computer and use it in GitHub Desktop.
Save lylayang/d0b55bed7581fe8623f6ddde29ceb53d to your computer and use it in GitHub Desktop.
from statsmodels.tsa.api import ExponentialSmoothing
fit1 = ExponentialSmoothing(np.asarray(train['Spend']) ,seasonal_periods=7 ,trend='add', seasonal='add').fit(use_boxcox=True)
test['Holt_Winter'] = fit1.forecast(len(test))
plt.figure(figsize=(16,8))
plt.plot( train['Spend'], label='Train')
plt.plot(test['Spend'], label='Test')
plt.plot(test['Holt_Winter'], label='Holt_Winter')
plt.legend(loc='best')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment