Prophet Changepoints
Use this skill after forecasting data preparation when the goal is to understand or control trend rate changes in a Prophet model.
Do not use Prophet as a general-purpose offline segmentation library or online minimal-delay changepoint detector. Official docs describe automatic trend changepoints inside a forecasting model.
Minimum Install
python -m pip install prophet
PyPI lists prophet 1.3.0 as the latest release, published January 27, 2026. The README also documents conda-forge installation.
Data Contract
- Use a pandas dataframe with
ds and y.
ds must be parseable by pandas, preferably YYYY-MM-DD or YYYY-MM-DD HH:MM:SS; timezone-aware datetimes are not supported.
y is a numeric single target. Prophet is univariate with optional regressors, holidays, capacities, floors, and seasonalities.
- For logistic growth, include
cap; include floor only when using a saturating minimum.
- For multiple entities/panels, fit one Prophet model per entity. Prophet is not documented as a global panel model.
- Add each extra regressor with
m.add_regressor(name) before fit; the column must exist in both training and prediction dataframes, and future values must be known.
Read references/prophet-data-workflow.md before adapting panels, manual changepoints, shocks, or operational forecasting workflows.
Core Pattern
from prophet import Prophet
from prophet.plot import add_changepoints_to_plot
m = Prophet(changepoint_prior_scale=0.05, n_changepoints=25, changepoint_range=0.8)
m.fit(df[["ds", "y"]])
future = m.make_future_dataframe(periods=90)
forecast = m.predict(future)
fig = m.plot(forecast)
add_changepoints_to_plot(fig.gca(), m, forecast)
Changepoint Controls
n_changepoints: number of potential changepoints if changepoints is not supplied; default is 25.
changepoint_range: proportion of history used for automatic potential changepoints; default is 0.8.
changepoint_prior_scale: sparse-prior strength for trend flexibility; default is 0.05. Larger values allow more/larger rate changes; smaller values dampen them.
changepoints: explicit dates where slope changes are allowed; all must fall within training data.
growth: documented trend choices are "linear", "logistic", and "flat".
Prophet places many possible changepoints and uses sparse regularization; do not interpret every potential changepoint as a detected process change. Inspect significant deltas.
Training, Prediction, and Inspection
- Fit with
m.fit(train_df); a Prophet object can only be fit once.
- Predict with
m.predict(future_df); output includes yhat, uncertainty columns, trend, and components.
- Inspect potential changepoint dates in
m.changepoints.
- Inspect fitted rate changes in
m.params["delta"]; average across draws before thresholding when MCMC is used.
- Plot significant changepoints with
add_changepoints_to_plot(fig.gca(), m, forecast, threshold=0.01).
- Use
m.plot_components(forecast) to separate trend, seasonality, holidays, and extra regressors.
Validation and Metrics
- Use
prophet.diagnostics.cross_validation with temporal cutoffs; never random split.
- Use
performance_metrics and choose forecast metrics such as RMSE, MAE, MAPE, MDAPE, SMAPE, and coverage.
- Tune
changepoint_prior_scale, n_changepoints, changepoint_range, seasonalities, holidays, and regressors only on train/validation cutoffs.
- If true changepoint labels exist, compare detected significant changepoint dates against labels with a task-specific date tolerance outside Prophet; Prophet does not document a built-in changepoint precision/recall metric.
Uncertainty
- Prophet returns
yhat_lower and yhat_upper by default.
interval_width controls interval width.
- Trend uncertainty assumes future trend changes follow the historical frequency and magnitude; docs warn not to expect calibrated coverage in all cases.
- Use
mcmc_samples > 0 only when full Bayesian sampling and seasonality uncertainty are needed.
Anti-Leakage Rules
- Split by time before outlier handling, scaling, regressor engineering, manual changepoint selection, hyperparameter tuning, or shock labeling.
- For forecasting, fit Prophet only on data available at each cutoff. Do not use full-history changepoints to justify past predictions.
- If adding regressors, future values must be known at prediction time.
- If modeling shocks as holidays/events, define event windows from information available at that cutoff.
- Keep validation/test changepoint labels out of train-time selection of
changepoint_prior_scale, changepoints, and changepoint_range.
Common Errors
- Treating Prophet changepoints as generic distributional segmentation.
- Using Prophet for online minimal-delay detection; this is not documented as a core capability.
- Passing timezone-aware
ds values.
- Forgetting
cap for logistic growth.
- Adding regressors after
fit, omitting them from future, using constant history regressors, or leaking unknown future regressor values.
- Overfitting outliers as trend changes; official docs recommend removing outliers by setting affected
y values to missing when appropriate.
- Increasing
changepoint_range near the series end without validating forecast stability.
References
- Read
references/prophet-data-workflow.md for data shape, panels, regressors, shocks, and leakage.
- Read
references/prophet-api-map.md for changepoint controls, plotting, diagnostics, and limitations.
- Read
references/official-sources.md for official sources consulted.
- Use
scripts/validate_prophet_changepoints.py to sanity-check CSV inputs and manual changepoint dates.
Ready Checklist
- Data has sorted, timezone-naive
ds and numeric y.
- The task is trend-changepoint analysis inside Prophet, not generic segmentation.
growth, changepoint_prior_scale, n_changepoints/changepoints, and changepoint_range are documented.
- Evaluation uses temporal cutoffs or fixed retrospective periods.
- All regressors, holidays, shocks, and manual changepoints obey train-only selection rules.
1---2name: changepoint-prophet3description: Use Prophet for trend changepoint analysis inside Prophet forecasting workflows after validating prepared time-series data, including ds/y pandas inputs, automatic or manual potential changepoints, changepoint prior tuning, trend deltas, forecast intervals, cross-validation, plotting significant changepoints, regressors, holidays/shocks, and leakage-safe retrospective or forecasting use.4---56# Prophet Changepoints78Use this skill after forecasting data preparation when the goal is to understand or control **trend rate changes** in a Prophet model.910Do not use Prophet as a general-purpose offline segmentation library or online minimal-delay changepoint detector. Official docs describe automatic trend changepoints inside a forecasting model.1112## Minimum Install1314```bash15python -m pip install prophet16```1718PyPI lists `prophet 1.3.0` as the latest release, published January 27, 2026. The README also documents conda-forge installation.1920## Data Contract2122- Use a pandas dataframe with `ds` and `y`.23- `ds` must be parseable by pandas, preferably `YYYY-MM-DD` or `YYYY-MM-DD HH:MM:SS`; timezone-aware datetimes are not supported.24- `y` is a numeric single target. Prophet is univariate with optional regressors, holidays, capacities, floors, and seasonalities.25- For logistic growth, include `cap`; include `floor` only when using a saturating minimum.26- For multiple entities/panels, fit one Prophet model per entity. Prophet is not documented as a global panel model.27- Add each extra regressor with `m.add_regressor(name)` before `fit`; the column must exist in both training and prediction dataframes, and future values must be known.2829Read `references/prophet-data-workflow.md` before adapting panels, manual changepoints, shocks, or operational forecasting workflows.3031## Core Pattern3233```python34from prophet import Prophet35from prophet.plot import add_changepoints_to_plot3637m = Prophet(changepoint_prior_scale=0.05, n_changepoints=25, changepoint_range=0.8)38m.fit(df[["ds", "y"]])39future = m.make_future_dataframe(periods=90)40forecast = m.predict(future)4142fig = m.plot(forecast)43add_changepoints_to_plot(fig.gca(), m, forecast)44```4546## Changepoint Controls4748- `n_changepoints`: number of potential changepoints if `changepoints` is not supplied; default is 25.49- `changepoint_range`: proportion of history used for automatic potential changepoints; default is 0.8.50- `changepoint_prior_scale`: sparse-prior strength for trend flexibility; default is 0.05. Larger values allow more/larger rate changes; smaller values dampen them.51- `changepoints`: explicit dates where slope changes are allowed; all must fall within training data.52- `growth`: documented trend choices are `"linear"`, `"logistic"`, and `"flat"`.5354Prophet places many possible changepoints and uses sparse regularization; do not interpret every potential changepoint as a detected process change. Inspect significant deltas.5556## Training, Prediction, and Inspection5758- Fit with `m.fit(train_df)`; a Prophet object can only be fit once.59- Predict with `m.predict(future_df)`; output includes `yhat`, uncertainty columns, `trend`, and components.60- Inspect potential changepoint dates in `m.changepoints`.61- Inspect fitted rate changes in `m.params["delta"]`; average across draws before thresholding when MCMC is used.62- Plot significant changepoints with `add_changepoints_to_plot(fig.gca(), m, forecast, threshold=0.01)`.63- Use `m.plot_components(forecast)` to separate trend, seasonality, holidays, and extra regressors.6465## Validation and Metrics6667- Use `prophet.diagnostics.cross_validation` with temporal cutoffs; never random split.68- Use `performance_metrics` and choose forecast metrics such as RMSE, MAE, MAPE, MDAPE, SMAPE, and coverage.69- Tune `changepoint_prior_scale`, `n_changepoints`, `changepoint_range`, seasonalities, holidays, and regressors only on train/validation cutoffs.70- If true changepoint labels exist, compare detected significant changepoint dates against labels with a task-specific date tolerance outside Prophet; Prophet does not document a built-in changepoint precision/recall metric.7172## Uncertainty7374- Prophet returns `yhat_lower` and `yhat_upper` by default.75- `interval_width` controls interval width.76- Trend uncertainty assumes future trend changes follow the historical frequency and magnitude; docs warn not to expect calibrated coverage in all cases.77- Use `mcmc_samples > 0` only when full Bayesian sampling and seasonality uncertainty are needed.7879## Anti-Leakage Rules8081- Split by time before outlier handling, scaling, regressor engineering, manual changepoint selection, hyperparameter tuning, or shock labeling.82- For forecasting, fit Prophet only on data available at each cutoff. Do not use full-history changepoints to justify past predictions.83- If adding regressors, future values must be known at prediction time.84- If modeling shocks as holidays/events, define event windows from information available at that cutoff.85- Keep validation/test changepoint labels out of train-time selection of `changepoint_prior_scale`, `changepoints`, and `changepoint_range`.8687## Common Errors8889- Treating Prophet changepoints as generic distributional segmentation.90- Using Prophet for online minimal-delay detection; this is not documented as a core capability.91- Passing timezone-aware `ds` values.92- Forgetting `cap` for logistic growth.93- Adding regressors after `fit`, omitting them from `future`, using constant history regressors, or leaking unknown future regressor values.94- Overfitting outliers as trend changes; official docs recommend removing outliers by setting affected `y` values to missing when appropriate.95- Increasing `changepoint_range` near the series end without validating forecast stability.9697## References9899- Read `references/prophet-data-workflow.md` for data shape, panels, regressors, shocks, and leakage.100- Read `references/prophet-api-map.md` for changepoint controls, plotting, diagnostics, and limitations.101- Read `references/official-sources.md` for official sources consulted.102- Use `scripts/validate_prophet_changepoints.py` to sanity-check CSV inputs and manual changepoint dates.103104## Ready Checklist105106- Data has sorted, timezone-naive `ds` and numeric `y`.107- The task is trend-changepoint analysis inside Prophet, not generic segmentation.108- `growth`, `changepoint_prior_scale`, `n_changepoints`/`changepoints`, and `changepoint_range` are documented.109- Evaluation uses temporal cutoffs or fixed retrospective periods.110- All regressors, holidays, shocks, and manual changepoints obey train-only selection rules.