A seasonal forecast is useful only if it beats a simple reference on data it did not see. Here, a custom NumPy least-squares trend-plus-seasonality model is replayed against public Wikipedia pageviews and compared with a seasonal-naive forecast.

  • Data: daily views of the English Wikipedia “Peyton Manning” page, not employer data.
  • Evaluation: 363 observed holdout days inside a 365-calendar-day test window.
  • Use: the model improves on this baseline for this series; its fitted residual interval is exploratory, not a calibrated commitment bound.
This example uses public daily pageviews from the Prophet repository's example dataset. It contains no employer systems or data.

At Chegg, I built seasonality-aware traffic and ad-inventory forecasts for direct-sales commitments and revenue planning. This smaller public-data example shows the evaluation logic without implying that one series or model transfers directly to another business. The source CSV is part of Prophet's example collection; the model here is a custom NumPy least-squares implementation, not Prophet.

Define the forecast question

The series is daily pageviews for the English Wikipedia “Peyton Manning” article in Prophet's example collection, from December 10, 2007 through January 20, 2016. The CSV stores log views; the analysis converts them back to views. It contains weekly patterns, yearly seasonality related to the NFL calendar, and event-driven variation. For definitions of forecast errors, holdout evaluation, and seasonal-naive methods, see Forecasting: Principles and Practice.

The forecast question is: using data available before the holdout, how well can the model predict daily views over the next year, and does it improve on repeating the same weekday from 52 weeks earlier?

Build a baseline and model

Forecast evaluation workflow

  1. Pin the source and cutoff

    Record the data version and forecast origin available at the time.

  2. Fit training data only

    Estimate trend and seasonal structure before the holdout begins.

  3. Replay a simple baseline

    Forecast the same dates with seasonal naive for a useful reference.

  4. Score observed days

    Compare actuals and forecasts with more than one error summary.

  5. Decide with limits

    Use rolling evaluations and calibrated uncertainty before commitments.

Holdout values are not used to fit the model.
  • Training window: 3 years (1,092 days), ending immediately before January 21, 2015.
  • Model: least squares on log views, with a linear trend, weekday effects, and 6 pairs of yearly Fourier terms.
  • Baseline: seasonal naive, using the same weekday 52 weeks earlier.
  • Holdout: the 365-calendar-day period from January 21, 2015 through January 20, 2016. The source has 363 observed days for the model in that window.
  • Interval: ±1.96 training-residual standard deviations on the log scale, converted back to views. This simple fitted-residual band is not calibrated for operational safety.

The model is fitted before the holdout. The seasonal-naive baseline is a rolling comparison, however: its 364-day lag means the last target day uses the first holdout day as its reference. It scores 362 paired observed days, while the seasonal model scores 363. The headline metrics therefore have almost—but not exactly—the same evaluation dates, and the baseline is not a fully fixed-origin year-ahead forecast.

Compare errors on the holdout

Avg daily views per week (log scale)3001.0K3.0K10K30KJan 14Apr 14Jul 14Oct 14Jan 15Apr 15Jul 15Oct 15Jan 16holdout begins this weekactualforecast
Weekly averages of public daily Wikipedia pageviews. The holdout begins Jan 21, 2015; its first plotted week includes pre-holdout actuals but only holdout forecasts. Error metrics use daily observations. Shading averages the daily residual-based 95% bounds; it is not an interval for the weekly mean.
Weekly average daily views: actual, forecast, and the daily 95% interval averaged over the week
Week ofActualForecastInterval
2014-01-2625,458——
2014-02-0285,766——
2014-02-093,778——
2014-02-162,444——
2014-02-232,250——
2014-03-022,192——
2014-03-092,238——
2014-03-161,885——
2014-03-232,625——
2014-03-301,717——
2014-04-061,677——
2014-04-131,634——
2014-04-202,277——
2014-04-271,964——
2014-05-043,597——
2014-05-112,204——
2014-05-182,022——
2014-05-252,256——
2014-06-011,621——
2014-06-081,598——
2014-06-151,407——
2014-06-221,290——
2014-06-291,425——
2014-07-061,505——
2014-07-131,899——
2014-07-202,047——
2014-07-272,571——
2014-08-032,567——
2014-08-103,464——
2014-08-173,127——
2014-08-243,791——
2014-08-314,389——
2014-09-0714,423——
2014-09-1410,307——
2014-09-216,673——
2014-09-284,395——
2014-10-058,154——
2014-10-126,165——
2014-10-1919,563——
2014-10-266,150——
2014-11-026,216——
2014-11-094,126——
2014-11-163,627——
2014-11-233,905——
2014-11-304,400——
2014-12-073,816——
2014-12-143,948——
2014-12-214,001——
2014-12-284,104——
2015-01-045,558——
2015-01-1115,416——
2015-01-187,2198,4742,769 to 25,933
2015-01-254,0628,5832,805 to 26,269
2015-02-0110,1306,2422,039 to 19,102
2015-02-083,0034,2371,385 to 12,967
2015-02-152,5932,978973 to 9,114
2015-02-221,7162,344766 to 7,172
2015-03-012,2722,113690 to 6,467
2015-03-081,8432,106688 to 6,445
2015-03-151,4392,164707 to 6,623
2015-03-221,6642,146701 to 6,566
2015-03-291,4561,986649 to 6,077
2015-04-051,1691,736567 to 5,312
2015-04-121,3221,500490 to 4,590
2015-04-191,6911,349441 to 4,129
2015-04-261,6501,301425 to 3,982
2015-05-031,4811,332435 to 4,077
2015-05-101,4631,387453 to 4,245
2015-05-172,3971,395456 to 4,269
2015-05-241,3001,311428 to 4,013
2015-05-311,1151,157378 to 3,539
2015-06-07979997326 to 3,051
2015-06-14909890291 to 2,725
2015-06-211,391864282 to 2,645
2015-06-28883924302 to 2,829
2015-07-051,0171,060347 to 3,245
2015-07-121,5581,241405 to 3,797
2015-07-191,4811,412461 to 4,320
2015-07-261,3161,531500 to 4,687
2015-08-021,4851,611527 to 4,931
2015-08-091,6401,719562 to 5,261
2015-08-161,9411,948637 to 5,963
2015-08-232,1282,394782 to 7,325
2015-08-302,4933,1191,019 to 9,544
2015-09-063,1844,0681,329 to 12,450
2015-09-136,7614,9631,622 to 15,189
2015-09-203,9415,3961,763 to 16,515
2015-09-274,9195,1901,696 to 15,882
2015-10-043,2574,5771,495 to 14,006
2015-10-112,7273,9421,288 to 12,063
2015-10-183,6143,5231,151 to 10,783
2015-10-253,0873,3681,101 to 10,309
2015-11-014,6303,4031,112 to 10,416
2015-11-083,8293,4831,138 to 10,659
2015-11-155,4143,4521,128 to 10,564
2015-11-223,5913,2511,062 to 9,949
2015-11-2943,8992,974972 to 9,103
2015-12-063,0292,795913 to 8,555
2015-12-132,5332,874939 to 8,794
2015-12-202,4183,3441,093 to 10,232
2015-12-275,6944,3281,414 to 13,247
2016-01-034,9445,8001,895 to 17,749
2016-01-103,4157,1712,343 to 21,947
2016-01-1714,4678,5582,796 to 26,190

Holdout error: model compared with seasonal naive

Lower is better. Percentages use each day's actual views as the denominator.

Mean absolute percentage error (MAPE)
Median absolute percentage error (MdAPE)
Exact holdout error metrics
MetricSeasonal modelSeasonal naive
Mean absolute percentage error (MAPE)36.4%95.3%
Median absolute percentage error (MdAPE)24.9%49.4%
Daily errors on the observed holdout days. This comparison evaluates this series and split; it does not establish future performance.
Daily error over observed holdout daysSeasonal modelSeasonal naive
Mean absolute percentage error (MAPE)36.4% (363 days)95.3% (362 days)
Median absolute percentage error (MdAPE)24.9% (363 days)49.4% (362 days)

Both metrics divide each day's absolute error by that day's actual views, then summarize across days. MAPE averages those percentages; MdAPE reports their median. The model's error is lower on both summaries in this comparison. Because one baseline reference day falls inside the holdout and the scored days differ by one, read this as a simple rolling benchmark rather than a strict fixed-origin comparison. It is evidence about this split, not a guarantee of future accuracy.

The difference between mean and median errors says the daily percentage errors are unevenly distributed. A low-traffic actual value can produce a large percentage error for a modest absolute miss; unusual event days can also create large absolute misses. MAPE's denominator makes it especially important to inspect the series and the error distribution, rather than attributing the result to spikes alone.

The largest observed holdout day was November 30, 2015, with 189,032 views, compared with a holdout average of 3,605. A calendar model cannot know an unmodeled news event in advance. The fitted interval covered 98.4% of observed days here, but that one example does not establish calibrated coverage or a safe planning range. Also, exponentiating a fitted log value gives a typical/median-style prediction under this model, not an unbiased expected mean of views; a mean forecast would need an appropriate bias correction.

Translate a forecast into an operating decision

  1. Convert views into inventory explicitly. Apply documented ad-load, eligibility, and fill assumptions; keep those assumptions separate from the traffic forecast.
  2. Treat known events as inputs. Add relevant launches, holidays, sports calendars, or school terms only when they are known at the forecast date and supported by the business context.
  3. Score the model on rolling holdouts. Track error by horizon, season, and traffic level; compare with simple baselines after each refresh.
  4. Choose a commitment bound from calibrated evidence. Backtest lower quantiles or another uncertainty method against the cost of over- and under-forecasting. This example's residual band is not ready to set a guarantee.

What I would test next

I would add event regressors where the event schedule is known, compare damped trends with the linear trend, and evaluate interval coverage over multiple rolling windows. The next model should earn operational use through repeatable out-of-sample performance, not just a better fit on training data.

For another measurement walkthrough, see how I design and interpret an A/B test, or try the ad-auction floor-price simulator.

Calculation notes: the Python analysis reads the pinned public dataset linked above and writes the chart data consumed by this site. Forecast values, evaluation counts, and error metrics in this article are populated from that same output. The dataset comes from Prophet's examples; the model is the custom least-squares specification described here.