A First Forecast Baseline
Naive and moving-average forecasts.
A First Forecast Baseline is a free Data Science Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Data Science Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Always Start Simple
Before fancy models, you need a baseline: a dead-simple forecast that anything fancier must beat to earn its place. 🪜
The Naive Forecast
The simplest baseline is the naive forecast: predict that tomorrow equals today. Surprisingly hard to beat for steady data.
forecast = sales.iloc[-1]Carrying the Last Value
A naive forecast just repeats the most recent observation forward. No trend, no season, just the latest known point.
The Seasonal Naive
For cyclical data, predict the value from one full season ago. This seasonal naive respects repeating patterns cheaply.
forecast = sales.shift(12)Moving-Average Forecast
Another baseline averages the last few points. A moving average smooths out noise and projects that level ahead.
forecast = sales.tail(7).mean()Split Before You Forecast
Keep the last chunk of time as a test set. Never shuffle it: time order must be preserved so the future stays unseen.
train, test = sales[:-30], sales[-30:]Measure the Error
Compare predictions to the held-out truth with an error metric. MAE reports the average size of your mistakes in real units.
from sklearn.metrics import mean_absolute_errorThe Number to Beat
Your baseline's error becomes the benchmark. Any model that scores worse is not worth its extra complexity.
Plot Truth Versus Forecast
Always plot the prediction over the real test values. Your eyes catch lag and bias that a single number can hide.
When Naive Wins
If a complex model cannot beat naive, trust the simple one. Simplicity that performs is a feature, not a failure.
Where to Go Next
With a baseline set, you are ready for real models like ARIMA or Prophet, each judged against this honest starting point.
Quick Check
What does a simple naive forecast predict for the next time step?
Recap: Earn the Complexity
You built naive, seasonal, and moving-average baselines, then measured error so future models must prove they are better.
Frequently asked questions
Is the “A First Forecast Baseline” lesson free?
Yes — the full text of “A First Forecast Baseline” is free to read here on the web, and the Data Science Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Data Science Academy course, upgrade to CoddyKit PRO.
What will I learn in “A First Forecast Baseline”?
Naive and moving-average forecasts. You practise Data Science Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Data Science Academy?
No prior experience is required. Data Science Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “A First Forecast Baseline” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Data Science Academy lesson?
Yes. Every Data Science Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Trend, Seasonality, and Noise
- Rolling Windows and Lags
- Stationarity and Differencing
- A First Forecast Baseline