# And that's it! The model is trained and ready to be used.<br>
# Let's forecast the next year using the model. To forecast using Prophet we need to first create an empty dataframe for future values. This data frame contains the future dates. Then we feed this dataframe to `.predict()` and will get the forecasted values.



future = model.make_future_dataframe(periods=365)
future.head()

# __Note:__ as you can see this data frame has only future dates.

forecast = model.predict(future)
forecast.head()

# The result contains various components of the time series. The forecasted values can be found on `yhat` column. It is difficult to see how model has performed, so let's plot the results. We can do that using Prophets built-in plot function.

fig = model.plot(forecast)
fig.gca().plot(df_validp.ds, df_validp['y'], 'k.', c='r', label='validation')
plt.legend()
''

# As you can see at some periods the predictions are poor and at some points they are pretty close. Let's have a closer look at the future.

fig = model.plot(forecast)
fig.gca().plot(df_validp.ds, df_validp['y'], 'k.', c='r', label='validation')
plt.xlim(pd.to_datetime(["2013-06-15", "2013-08-15"]))
plt.ylim([10, 24])

# The model has found annual and weekly seasonalities. We can have closer look at these components using `.plot_components()`

model.plot_components(forecast)
1