1. Learn
  2. /
  3. Courses
  4. /
  5. Designing Forecasting Pipelines for Production

Connected

Exercise

Calculating a threshold and moving averages

You'll track forecast accuracy over time to detect model drift. By calculating rolling windows and defining a threshold level for triggering drift alerts, you can identify when the model becomes misaligned with reality and requires retraining.

You'll use the first 14 forecasts from fc_log_test to establish the threshold, then apply it to the remaining forecast logs. The forecast logs fc_log_test and fc_log containing model performance scores have been preloaded, along with pandas as pd.

Instructions

100 XP
  • Define the threshold level from fc_log_test by adding three standard deviations to the RMSE mean, storing as rmse_threshold.
  • Calculate the RMSE moving average using 7-day and 14-day rolling windows for fc_log.