Skip to content

Tomorrow's Number

You'll forecast something that moves day by day, split by time instead of at random, and try to beat the model that just says 'same as yesterday'.

About

Forecasting is where otherwise careful people leak the future into the past, because a random split lets the model train on Tuesday to predict Monday. Time series needs a split by date, a baseline that's embarrassingly hard to beat, and features that only use what you'd have known at the time. Pick a daily series with at least a year of history (a city's temperature, bike-share rentals, your own electricity meter, a river gauge, store footfall), which weather services and open data portals publish for free. What counts is a model scored on the last few months only, against the naive baseline, with a chart of forecasts over the truth.

At a glance

Per requirement
35 XP
Completion bonus
300 XP
Requirements
5
Takes
Two weekends, then a week of waiting
Skill level
Intermediate (months of practice)
Cost
Free
Supplies
Nothing special
Where
At home
Other people
On your own
Locked for now
Earn two more Uncommon badges in Machine Learning to open this one. Log in to see how far along you are.

Requirements

  1. 1
    Find a daily series with a year or more of history and plot the whole thing. Look for a weekly rhythm, a seasonal swing and any gaps or spikes. Mark where the gaps are and decide how to fill them (carrying the last value forward is honest; interpolation can hide a broken sensor). Write down the date you'll cut at: everything before is training, everything after is test. Take a screenshot of the plot with the cut line drawn. Photo
  2. 2
    Score the naive baselines first. Three of them: predict yesterday's value, predict the value from seven days ago, and predict the average of the last seven days. Compute the mean absolute error for each on the test period only. Write all three down, because your model has to beat the best of them, not the worst. Take a screenshot of the three errors. Photo
  3. 3
    Build lag features using only the past, and train a model on the training period. Columns like the value one, two, seven and fourteen days ago, the day of the week, and a rolling seven-day mean that ends yesterday, not today. Check a few rows by hand to make sure nothing leaks from the future. Train gradient boosting or ridge regression. Take a screenshot of the feature table with one row's lags checked by hand. Photo
  4. 4
    Forecast the test period one day at a time and plot it over the truth. Walk forward day by day, feeding in the real past values as they would have arrived. Plot forecast and actual on the same axes for the test months, with the naive baseline as a faint third line. Report mean absolute error next to the best baseline. If you're within a few percent of naive, say so; that's a normal result and an honest one. Take a screenshot of the chart. Photo
  5. 5
    Forecast the next seven real days, wait a week, and score yourself. Make the seven forecasts and put them somewhere with a timestamp you can't edit, like a message to a friend or a commit, then wait a week and compare them with what happened. Report the error and whether the best naive baseline would have done better. This is the only test that can't leak. Post a screenshot of the timestamped forecasts next to the actuals and the error, with two sentences on what you'd change. Photo