Created
March 23, 2020 03:32
-
-
Save lylayang/0cb97e6f59efd07c2bfa65521c0f0589 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import statsmodels.api as sm | |
fit1 = sm.tsa.statespace.SARIMAX(train.Spend, order=(7, 1, 2), seasonal_order=(0, 1, 2, 7)).fit(use_boxcox=True) | |
test['SARIMA'] = fit1.predict(start="2019-07-23", end="2019-09-23", dynamic=True) | |
plt.figure(figsize=(16, 8)) | |
plt.plot(train['Spend'], label='Train') | |
plt.plot(test['Spend'], label='Test') | |
plt.plot(test['SARIMA'], label='SARIMA') | |
plt.legend(loc='best') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment