Skip to content

Instantly share code, notes, and snippets.

@oba11
Last active May 6, 2020 02:45
Show Gist options
  • Save oba11/89224f415c65ccf752f9efcd7c5b8d49 to your computer and use it in GitHub Desktop.
Save oba11/89224f415c65ccf752f9efcd7c5b8d49 to your computer and use it in GitHub Desktop.
%%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