Creating a Prophet performance metrics DataFrame
Now that you’ve learned what the different options are for performance metrics in Prophet, let’s start coding and see how to access them. We’ll use the same online retail sales data we used in Chapter 12, Performing Cross-Validation. Along with our usual imports, we are going to add the performance_metrics
function from Prophet’s diagnostics
package and the plot_cross_validation_metric
function from the plot
package:
import pandas as pd import matplotlib.pyplot as plt from prophet import Prophet from prophet.plot import add_changepoints_to_plot from prophet.diagnostics import cross_validation from prophet.diagnostics import performance_metrics from prophet.plot import plot_cross_validation_metric
Next, let’s load the data, create our forecast, and plot the results:
df = pd.read_csv('online_retail.csv') df.columns = ['ds', 'y'] model = Prophet(yearly_seasonality...