import matplotlib.pyplot as plt
fig = plt.figure(facecolor='w', figsize=(10, 6))
ax = fig.add_subplot(111)
forecasts = pyfunc_model._model_impl.python_model.predict_timeseries(include_history=True)
fcst_t = forecasts['ds'].dt.to_pydatetime()
ax.plot(df_true['date'].dt.to_pydatetime(), df_true['y'], 'k.', label='Observed data points')
ax.plot(fcst_t, forecasts['yhat'], ls='-', c='#0072B2', label='Forecasts')
ax.fill_between(fcst_t, forecasts['yhat_lower'], forecasts['yhat_upper'],
color='#0072B2', alpha=0.2, label='Uncertainty interval')
ax.legend()
plt.show()
AutoML forecasting example
Requirements
Databricks Runtime for Machine Learning 10.0 or above.
To save model predictions, Databricks Runtime for Machine Learning 10.5 or above.