Reputation: 416
When I plot with facebook prophet model by the following code:
number_of_days_in_future = 20
future = m.make_future_dataframe(periods=number_of_days_in_future, freq="D")
weekend = future[future['ds'].dt.dayofweek < 5 ]
prediction = m.predict(weekend)
m.plot(prediction)
plt.title("Prediction of Value")
plt.xlabel("Date")
plt.ylabel("Value")
plt.show()
It shows plotting from the beginning of historical data like below:
It's difficult to understand the value from the graph as it spans large range for Y-axis.
But if I forecast only for few days. It's easier to understand the value from Y-axis like this:
My questions are:
Upvotes: 2
Views: 2889
Reputation: 151
To ignore the shadow part, attribute to the 'uncertainty' plot parameter as 'False'.
Upvotes: 0
Reputation: 416
I just found a way from fbprophet repository to fulfill my requirements.
fig = m.plot(prediction)
ax = fig.gca()
# setting x limit. date range to plot
ax.set_xlim(pd.to_datetime(['2020-08-19', '2020-08-25']))
# we can ignore the shadow part by setting y limit
ax.set_ylim([26, 29])
Upvotes: 6