A bike-hire kiosk logs its rentals once a day, and the numbers follow a strong weekly rhythm: busy weekends, quiet Tuesdays. Before anyone trains a forecaster, the team wants the bar it will have to beat: the errors of the two free forecasts on the same test days.
The series is split at a cut-off. series[:cutoff] is the known past, and series[cutoff:] is the test block. Bikes are ordered in advance, so every forecast for the test block is written once, on the evening of the cut-off. No value from the test block is known when any forecast is made, not even the first test day's value when forecasting the second.
period steps: every test day is forecast as the most recent known value from the same point in the cycle, that is, a value a whole number of periods earlier that lies before the cut-off.Score each forecast with the MAE (mean absolute error) over the test block.
Task: write baseline_errors(series, cutoff, period) returning a tuple (naive_mae, seasonal_mae), each rounded to 4 decimal places. You may assume period <= cutoff < len(series).
Whichever of the two MAEs is smaller is the bar. A model that can't get under it isn't worth deploying: a rule with nothing to train already does that well.