<jupyter_start><jupyter_text>https://github.com/facebook/prophet Importing all the required libraries<jupyter_code>import pandas as pd
from prophet import Prophet
from prophet.plot import add_changepoints_to_plot<jupyter_output>Importing plotly failed. Interactive plots will not work.<jupyter_text>Reading data from AirPassengers.csv and loading it onto a Pandas dataframe<jupyter_code>data = pd.read_csv('./dataset/airpassengers.csv')<jupyter_output><empty_output><jupyter_text>Name the field 'Month' to 'ds'(time series) and 'Passengers' to 'y'(data)<jupyter_code>df = pd.DataFrame()
df['ds'] = pd.to_datetime(data['Month'])
df['y'] = data['#Passengers']
df.head()<jupyter_output><empty_output><jupyter_text>Initialise a model and fit our dataframe<jupyter_code>m = Prophet()
m.fit(df)<jupyter_output>INFO:prophet:Disabling weekly seasonality. Run prophet with weekly_seasonality=True to override this.
INFO:prophet:Disabling daily seasonality. Run prophet with daily_seasonality=True to override this.<jupyter_text>Make future dataframe rows for 5 from the last available date(we are going the forecast 5 years of data)<jupyter_code>future = m.make_future_dataframe(periods=12 * 5, freq='M')
future.tail()<jupyter_output><empty_output><jupyter_text>Predict and display the prediction<jupyter_code>forecast = m.predict(future)
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper', 'trend', 'trend_lower', 'trend_upper']].tail()<jupyter_output><empty_output><jupyter_text>Display the prediction on graphs<jupyter_code>fig1 = m.plot(forecast)
fig2 = m.plot_components(forecast)
fig = m.plot(forecast)
a = add_changepoints_to_plot(fig.gca(), m, forecast)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11712247324613555, 'fraction_numerical': 0.004161712247324614, 'mean_word_length': 9.077844311377245, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 1, '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': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '108349', 'license': 'MIT', 'n_tokens_mistral': 588, 'n_tokens_neox': 569, 'n_words': 125, 'path': 'prophet_Forecasting_AirPassengers.ipynb', 'repo_name': 'rickyxume/TimeSeries-Forecasting', 'size': '1682'}