KatInterview

Forecasting Next-Day Energy Use Across Commercial Buildings

Machine LearningModel answer
HardModel answerMachine Learningtime-seriesregressionfeature-engineering

Last updated

Design a full forecasting pipeline for next-day electricity use across many commercial buildings, from features and validation through deployment, monitoring, privacy and an ablation study.

You are asked to design a complete machine learning system that predicts, for each commercial building in a portfolio, the total electricity consumed (in kWh) on the following day.

Data you can use

  • Hourly smart-meter readings per building.
  • Weather: temperature, humidity and wind.
  • Calendar information, including holidays.
  • Building metadata: floor area, year built, HVAC type.
  • Optional external signals: day-ahead electricity price and outage alerts.
  • History spans 2019 to 2025.

Walk through the following in your answer

  1. Define the prediction problem precisely and propose baseline models.
  2. Describe the features you would build for seasonality, interactions (for example temperature with HVAC type) and occupancy proxies.
  3. Explain how you would regularize the model, handle multicollinearity, and detect and reduce heteroscedasticity.
  4. Describe time-series-aware cross-validation and how you prevent leakage. Be explicit about any lag or rolling-window features and which days they may touch.
  5. Choose evaluation metrics (such as RMSE and MAPE) and translate them into business-facing service levels, such as billing tolerance bands.
  6. Explain how you handle missing or corrupted sensor data and concept drift across the years.
  7. Outline production training and inference pipelines, model versioning, and monitoring (data and feature drift, residual shifts, retraining triggers).
  8. Explain how you would make predictions understandable to non-ML stakeholders (global and per-prediction views) and how the system fails safely.
  9. State the security and privacy measures required for tenant data.

Finally, propose an ablation plan that measures the added value of the external features, and describe how you would backtest the whole pipeline on 2023 to 2024 while keeping 2025 untouched as a final holdout.

Hints

Hint 1

Start by fixing the forecast cutoff time. Whether yesterday's meter data is complete when you run decides the smallest legal lag and which weather inputs (forecast vs. observed) are allowed.

Hint 2

Use a simple, industry-standard baseline (seasonal naive and a per-building degree-day model) and a size-normalized, log-scaled target so one global model can serve buildings of very different sizes.

Hint 3

For validation, use rolling-origin splits with a gap at least as long as the horizon plus the longest lag, fit all transformations inside each fold, and join weather forecasts and metadata as of the forecast time. For the ablation, keep everything fixed except the feature group under test.