Views
No views yet
consumo_m3_per_capita) at neighborhood level.| Hyperparameter | Value |
|---|---|
| Input window | 12 months |
| Nodes | 53 barrios |
| Node features | 16 |
| Hidden size | 64 |
| Chebyshev order K | 3 |
| Attention heads | 2 |
| Dropout | 0.30 |
| Node drop (training) | 0.05 |
| Epochs trained | 563 |
| Feature | Description |
|---|---|
consumo_m3_per_capita | Target (lag input) |
consumo_por_contrato | m³ per active contract |
temp_media_c | Monthly mean temperature (AEMET) |
temp_max_c | Monthly max temperature (AEMET) |
precip_mm | Monthly precipitation (AEMET) |
etp_mm | Evapotranspiration — Thornthwaite |
pernoctaciones | Hotel overnight stays (INE tabla 2074) |
ipc_idx | CPI index (INE IPC251852) |
mes_sin / mes_cos | Cyclical month encoding |
n_festivos | Public holidays in month |
hogueras_flag | Hogueras de San Juan festival |
semana_santa_flag | Holy Week flag |
ratio_contratos | Contract ratio vs. city mean |
pct_dom | % domestic contracts |
covid_flag | COVID-19 disruption period |
| Metric | Value |
|---|---|
| R² | 0.953 |
| MAE | 0.902 m³/person |
| RMSE | 2.212 m³/person |
| MAPE | 9.0 % |
| File | Description |
|---|---|
stgcn_v2_weights.pt | PyTorch model weights (state dict) |
stgcn_v2_config.json | Full architecture config & evaluation metrics |
stgcn_v2_target_mean.npy | Per-node target mean (for denormalization) |
stgcn_v2_target_std.npy | Per-node target std (for denormalization) |
adjacency_matrix.csv | 53×53 geographic adjacency matrix |
1import torch, json
2import numpy as np
3
4# Load config
5with open("stgcn_v2_config.json") as f:
6 cfg = json.load(f)
7
8# Load normalisation
9target_mean = np.load("stgcn_v2_target_mean.npy") # shape (53,)
10target_std = np.load("stgcn_v2_target_std.npy") # shape (53,)
11
12# Load model (define STGCNv2 class matching config first)
13model = STGCNv2(
14 n_nodes=cfg["n_nodes"],
15 n_features=cfg["n_features"],
16 hidden=cfg["hidden"],
17 cheb_k=cfg["cheb_k"],
18 n_heads=cfg["n_heads"],
19 dropout=cfg["dropout"],
20)
21model.load_state_dict(torch.load("stgcn_v2_weights.pt", map_location="cpu"))
22model.eval()
23
24# Input: x of shape (batch, window=12, n_nodes=53, n_features=16)
25# Output: shape (batch, n_nodes=53) — normalised predictions
26# Denormalise: pred_real = pred_norm * target_std + target_meanEquipo AGUARDIENTE (2025). AquaTwin: Digital Twin for Urban Water Consumption
using Spatio-Temporal Graph Convolutional Networks.
AMAEM Hackathon, Alicante, Spain.