Created
March 12, 2020 22:44
-
-
Save sammyrulez/171871554a36d4b8ae5a1cd41f414572 to your computer and use it in GitHub Desktop.
This file contains 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
m = Prophet() | |
m.add_regressor('peak_reg') | |
m.add_seasonality('peak_period_start',period=22,fourier_order=1) | |
m.add_seasonality('peak_period_end',period=36,fourier_order=1) | |
m.fit(df) | |
future = m.make_future_dataframe(periods=28) | |
future['ds_ts'] = pd.to_datetime(future['ds']) | |
future['no_school'] = pd.Timestamp(datetime(2020,2,24)) | |
future['since_no_school'] = future['ds_ts'].sub(future['no_school'], axis=0).dt.days | |
future['peak_reg'] = future['since_no_school'].apply(peak_days ) | |
forecast = m.predict(future) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment