import pandas as pd
from fbprophet import Prophet
df = pd.read_csv('https://raw.githubusercontent.com/danielcaraway/data/master/ca_train.csv')
df.head()
sm = df[['Date', 'ConfirmedCases']]
sm.columns = ['ds','y']
m = Prophet()
m.fit(sm)
future = m.make_future_dataframe(periods=365)
future.tail()
forecast = m.predict(future)
fig1 = m.plot(forecast)
def get_prof_preds_for(df, n):
m = Prophet()
m.fit(df)
future = m.make_future_dataframe(periods=n)
forecast = m.predict(future)
fig1 = m.plot(forecast)
get_prof_preds_for(sm, 60)
get_prof_preds_for(sm, 30)
get_prof_preds_for(sm, 10)
sm
get_prof_preds_for(sm[20:],10)
def get_prof_preds_for(df, n):
m = Prophet(daily_seasonality=True)
m.fit(df)
future = m.make_future_dataframe(periods=n)
forecast = m.predict(future)
fig1 = m.plot(forecast)
get_prof_preds_for(sm[20:],10)
get_prof_preds_for(sm[40:],10)
get_prof_preds_for(sm[40:],60)
get_prof_preds_for(sm[47:],30]
get_prof_preds_for(sm[47:],20)
sm = df[['Date', 'Fatalities']]
sm.columns = ['ds','y']
get_prof_preds_for(sm, 20)
sm
get_prof_preds_for(sm[47:], 20)