Power consumption forecasting across three zones of Tetouan, Morocco. XGBoost reduces MAPE from 21-27% to under 1%. Forecasting horizon and sampling frequency analysis quantify the deployment tradeoffs.
# Tetouan City Energy Consumption Forecasting
10-minute interval power consumption forecasting across three distribution zones
in Tetouan, Morocco (2017), using XGBoost with temporal feature engineering to
reduce MAPE from 21--27% (ARIMA baseline) to **under 1%** in two of three zones.
Zone 3 remains harder at 2.51%. At a one-week horizon, Zone 3 error reaches 16.23%
while Zones 1 and 2 stay below 7%. Dropping collection frequency from 10 to
60 minutes costs 5 percentage points in Zone 3 but only 2 in Zone 1.
Beyond accuracy, the analysis asks whether three geographically distinct zones
are driven by the same factors, how performance degrades across forecasting
horizons, and what coarser sampling frequencies actually cost in precision.
These are the questions that determine whether a model is usable in deployment.
See business recommendations →
## Motivation
An earlier project (NYC Citibike Demand Analysis)
used Bayesian Structural Time Series to understand *why* ridership differs
across rider types: inference, not prediction. This project takes the
complementary approach. Given a full year of 10-minute power consumption data
across three zones of Tetouan, Morocco, how accurately can we predict what
comes next?
The problem generalizes to any utility: electricity, gas, water. Grid operators
need accurate short-term forecasts to anticipate demand, allocate resources, and
respond to unexpected spikes before they become outages. At the user level,
zone-level forecasts can surface when and why consumption peaks, and SHAP
importance answers which external factors actually drive it.
## Design Decisions
**Why XGBoost over a neural network?**
On moderately sized tabular time series data, XGBoost with engineered lag and
calendar features matches or outperforms neural networks without the tuning
overhead. More importantly, XGBoost supports SHAP directly, which lets us
decompose each prediction into feature contributions and explain to operators
exactly what is driving …