Regularizing changepoints
As stated earlier, Prophet will place 25 potential changepoints in the first 80% of the time series by default. To control Prophet’s automatic changepoint detection, you can modify both of these values with the n_changepoints
and changepoint_range
arguments during model instantiation. For example, changing the number of potential changepoints to 5
is done like this:
model = Prophet(seasonality_mode='multiplicative', yearly_seasonality=4, n_changepoints=5)
This results in five evenly spaced potential changepoints in the first 80% of the data, as shown here:
Figure 8.5 – Five potential changepoints
Or, you could instead force all 25 changepoints to lie not in the first 80% of data, but rather in the first 50%:
...