<jupyter_start><jupyter_text>New Deaths<jupyter_code>new_death_df=newcase_death_df[['date','state_name','new_deaths']]
new_death_df
new_death_df2=new_death_df.pivot(index='date', columns='state_name', values='new_deaths')
new_death_df2
new_death_df3=new_death_df2.sum(axis=1)
new_death_us=new_death_df3.to_frame().reset_index()
new_death_us.columns = ['ds','y']
new_death_us['ds'] = pd.to_datetime(new_death_us['ds'])
new_death_us
m = Prophet(interval_width=0.95,n_changepoints=26,
    yearly_seasonality=True,
    weekly_seasonality=True,
    daily_seasonality=True,
    seasonality_mode='additive')
m.fit(new_death_us)
future = m.make_future_dataframe(periods=10)
future.tail()
#predicting the future with date, and upper and lower limit of y value
forecast = m.predict(future)
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']]
new_death_forecast_plot = m.plot(forecast)<jupyter_output><empty_output><jupyter_text>New Hospitalizations<jupyter_code>new_hos_df=newcase_death_df[['date','state_name','new_hospitalizations']]
new_hos_df
new_hos_df2=new_hos_df.pivot(index='date', columns='state_name', values='new_hospitalizations')
new_hos_df2
new_hos_df3=new_hos_df2.sum(axis=1)
new_hos_us=new_hos_df3.to_frame().reset_index()
new_hos_us.columns = ['ds','y']
new_hos_us['ds'] = pd.to_datetime(new_hos_us['ds'])
new_hos_us
m = Prophet(interval_width=0.95,n_changepoints=26,
    yearly_seasonality=True,
    weekly_seasonality=True,
    daily_seasonality=True,
    seasonality_mode='additive')
m.fit(new_hos_us)
future = m.make_future_dataframe(periods=10)
future.tail()
#predicting the future with date, and upper and lower limit of y value
forecast = m.predict(future)
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail(11)
new_hos_forecast_plot = m.plot(forecast)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13802660753880266, 'fraction_numerical': 0.015521064301552107, 'mean_word_length': 10.424050632911392, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '413202', 'license': 'MIT', 'n_tokens_mistral': 741, 'n_tokens_neox': 710, 'n_words': 89, 'path': "Leo's sandbox/COVID_data_fbprophet_prediction.ipynb", 'repo_name': 'DutchDS/Final_Project', 'size': '1804'}