Naive seasonal baseline
Quick answer
Naive forecasts predict the most recent observed value. Seasonal naive forecasts repeat the most recent observed cycle, providing a strong baseline when seasonality is stable. Examples are static Python snippets tested locally on CPU; Statsmodels and scikit-learn are required for selected examples. ByteMind execution is unverified.
Repeat a seasonal cycle
history=[8,9,10,20,30]s=3print([history[-s+i%s] for i in range(5)])Expected output (locally tested): [10, 20, 30, 10, 20]. All five predictions use only the observed last cycle.
How it works
At origin o with immediate observations, naive yhat[o+h]=y[o] for h>=1. With period s and zero-based history of length n=o+1, seasonal naive forecast for horizon h uses y[n-s+((h-1) mod s)]. This repeats the final fully observed seasonal block even for h>s. For rolling one-step evaluation the most recent actual observation may become available between forecasts, but a fixed-origin multi-step forecast must not use future actuals. Compare MAE (average absolute error), RMSE (square-root mean squared error), and signed bias with explicit convention. MAPE divides by absolute actual value and is undefined at zero; near-zero values can dominate it. Avoid silently dropping zeros or substituting arbitrary epsilons; report MAE or a documented alternative. MASE scales MAE by training mean absolute seasonal-naive difference; zero denominator is undefined. Baselines must receive the same origin, horizon, availability and partitions as the model. A model that loses to a baseline may still teach a useful negative result; do not tune after test evaluation.
Zero-safe MAE
actual=[0,5,10];pred=[2,4,8]print(round(sum(abs(a-p) for a,p in zip(actual,pred))/len(actual),3),any(a==0 for a in actual))Expected output (locally tested): 1.667 True. MAE handles zero targets; MAPE is undefined here.
Common mistakes
Do not use actual future values for fixed-origin forecasts or claim that MAPE is meaningful for zero demand. Do not compare one-step baseline errors with a seven-step model.
Practice and next steps
Forecast five days from the final three observations [10,20,30] with period 3. Compare naive and seasonal naive and specify which observations are known.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Naive seasonal baseline — knowledge check
Apply naive seasonal baseline to small examples and debugging scenarios.
What is a fixed-origin naive forecast?
What is seasonal naive at horizon exceeding the period?
Why is MAPE problematic at zero?
What scales MASE?
What must match in baseline comparison?