<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Prohpet documentation
Step1:  The input to Prophet is always a dataframe with two columns
Step2:  It looks like we have a exponential growth trend in the data, so in order to accomodate for the linear fitting we take the log.
Step3:  We only have monthly data, so certainly there will be no weekly seasonality in the date. Also forecasting must take this into account and choose the right frequency.
Step4:  Predictions are then made on a dataframe with a column ds containing the dates for which a prediction is to be made. You can get a suitable dataframe that extends into the future a specified number of days using the helper method Prophet.make_future_dataframe. By default it will also include the dates from the history, so we will see the model fit as well.
Step5:  The predict method will assign each row in future a predicted value which it names yhat. If you pass in historical dates, it will provide an in-sample fit. The forecast object here is a new dataframe that includes a column yhat with the forecast, as well as columns for components and uncertainty intervals.
Step6:  If you want to see the forecast components, you can use the Prophet.plot_components method. By default you’ll see the trend, yearly seasonality, and weekly seasonality of the time series. If you include holidays, you’ll see those here, too.
<ASSISTANT_TASK:>
Python Code:
import pandas as pd
import numpy as np
from fbprophet import Prophet
DATA_HOME_DIR = '/data/airline'
Explanation: Prohpet documentation
End of explanation
df = pd.read_csv(DATA_HOME_DIR+'/international-airline-passengers.csv',
                 sep=';',
                 names=['ds', 'y'],
                 header=0,
                 parse_dates=[0],
                 nrows=144,
                )
df.head(3)
df.info()
Explanation: The input to Prophet is always a dataframe with two columns: ds and y. The ds (datestamp) column must contain a date or datetime (either is fine). The y column must be numeric, and represents the measurement we wish to forecast.
End of explanation
df['y'] = np.log(df['y'])
Explanation: It looks like we have a exponential growth trend in the data, so in order to accomodate for the linear fitting we take the log.
End of explanation
m = Prophet(weekly_seasonality=False)
m.fit(df)
Explanation: We only have monthly data, so certainly there will be no weekly seasonality in the date. Also forecasting must take this into account and choose the right frequency.
End of explanation
future = m.make_future_dataframe(periods=36, freq='M')
future.tail()
Explanation: Predictions are then made on a dataframe with a column ds containing the dates for which a prediction is to be made. You can get a suitable dataframe that extends into the future a specified number of days using the helper method Prophet.make_future_dataframe. By default it will also include the dates from the history, so we will see the model fit as well.
End of explanation
forecast = m.predict(future)
forecast[['ds', 'yhat', 'yhat_lower', 'yhat_upper']].tail()
m.plot(forecast)
Explanation: The predict method will assign each row in future a predicted value which it names yhat. If you pass in historical dates, it will provide an in-sample fit. The forecast object here is a new dataframe that includes a column yhat with the forecast, as well as columns for components and uncertainty intervals.
End of explanation
m.plot_components(forecast)
Explanation: If you want to see the forecast components, you can use the Prophet.plot_components method. By default you’ll see the trend, yearly seasonality, and weekly seasonality of the time series. If you include holidays, you’ll see those here, too.
End of explanation
<END_TASK>