Quick Reference · time-series forecasting · prophet 1.4

prophet cheat sheet

Prophet fits an additive model: a series is the sum of a trend, a set of seasonalities, holiday effects, and noise. Feed it a two-column frame — ds and y — and it follows the sklearn fit → predict rhythm. Learn the pipeline once and every knob hangs off one of the four components.

data / io core pipeline seasonality trend & changepoints holidays & regressors diagnostics & tuning gotcha most common

Distilled & cross-checked against: facebook.github.io/prophet · github.com/facebook/prophet · Taylor & Letham, "Forecasting at Scale" (2017) · CRAN prophet reference manual · pypi.org/project/prophet · verified 2026-08-28 against prophet 1.4.0 (15 Aug 2026; Python ≥ 3.10; project is in maintenance mode — bug/dependency fixes only)

The pipeline — from a two-column frame to a forecast with uncertainty
DataFrame ds · y date + numeric value only Prophet(...) the model object + add_seasonality + add_country_holidays .fit(df) learn components trend · season holidays · noise make_future_ dataframe() extend N periods includes history .predict() → forecast yhat yhat_lower / upper m.plot() · m.plot_components() cross_validation() PREPARE FIT FORECAST
y(t)= g(t)trend+ s(t)seasonality+ h(t)holidays+ ε(t)noise  ·  a generalized additive model — each piece is interpretable & plotted separately
01Install & Importonce per env
02The Data Contractds & y, always
03Core Pipelinethe whole job
04Read the Forecastforecast columns
05Visualizesee the fit
06Seasonalitys(t) · Fourier
07Trend & Changepointsg(t) · the #1 knob
08Saturating Growthlogistic · cap/floor
09Holidays & Eventsh(t)
10Extra Regressorsexternal drivers
11Uncertainty Intervalsthe band
12Cross-Validationrolling origin
13Hyperparameter Tuningwhat to sweep
14Save & Loadpersist a model
Prophet() defaultskey params

How Prophet thinks

Four ideas do most of the work — the additive split, a bendable trend, Fourier seasonality, and rolling-origin validation. Diagrams follow the "Forecasting at Scale" paper & the official docs.

y = trend + seasonality + holidays + noise

The whole model. Prophet fits each piece separately, then adds them — which is why every component can be plotted on its own.

y(t) observed = g(t) trend + s(t) season + h(t) holidays + ε(t) noise

Piecewise trend & changepoints

The trend is straight segments whose slope may change at a few automatically-chosen changepoints. Growth can also be logistic (toward a cap) or flat.

cp cp linear (piecewise) cap logistic flat — no growth

Fourier order = seasonal wiggle

Each seasonality is a partial Fourier sum. A low order gives a smooth cycle; a high order fits fast changes — and overfits if pushed too far.

order 3 — smooth order 20 — fits fast changes, risks overfit one period →

Cross-validation: rolling origin

Fit up to a cutoff, forecast one horizon ahead, compare to truth — then slide the cutoff forward by period and repeat.

time → initial train horizon horizon horizon period | = cutoff

Worth memorizing

ds + ythe only two columns ever required; ds must be datetime-parseable
fit ≠ predictpredict needs a frame from make_future_dataframe
changepoint_prior_scalethe #1 knob — ↑ flexible, ↓ smooth; sweep log 0.001–0.5
additive vs mult.multiplicative when swings grow with the trend
logistic ⇒ capneeds a cap column in both history & future df
regressorsthe column must exist in the future df too
CV = rolling originmove the cutoff forward — never shuffle / k-fold time
interval_widthdefault is 0.80, not 0.95 — widen it if you report 95%
band = trend + noiseseasonality is "certain" unless mcmc_samples>0
save as JSONmodel_to_json — never pickle a Prophet model