Last active
May 6, 2020 02:45
-
-
Save oba11/89224f415c65ccf752f9efcd7c5b8d49 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
%%time | |
!conda install -c conda-forge fbprophet | |
!pip install [email protected]/oba11/pylib#egg=obalib | |
from fbprophet import Prophet | |
from obalib.athena import Athena | |
from obalib.s3 import S3 as s3_client | |
_, bucket, query_id = Athena.query('corona_cases', 'SELECT event_day as ds, cases as y FROM country') | |
data_location = f'{bucket}{query_id}.csv' | |
df = pd.read_csv(data_location) | |
df['ds'] = pd.DatetimeIndex(df['ds']) | |
m=Prophet(interval_width=0.90, changepoint_prior_scale=0.5).fit(df) | |
future_dates = m.make_future_dataframe(periods=14) | |
forecast = m.predict(future_dates) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment