Spaces:
Sleeping
Sleeping
Commit History
-
fix(inference): correct ratio-domain pipeline + add theory/status docs
sisidhar-ciscoThe model predicts a 336h-rolling-median RATIO, not absolute AQI. Both inputs and target live in ratio space; serving previously fed absolute values into a ratio-scaled model. Verified end-to-end against final.csv (predicted ratio 1.534 x median 36.1 = 55.4 recovered vs 60.8 actual). Inference / app.py: - Ratio-transform model inputs: each feature / its own shift(1).rolling(336).median() - Recover absolute AQI on output: target_scaler.inverse_transform(out) * rolling_median - Fail-loud TKAN import (no zero-returning stub); abort startup if unavailable - Scaler divide-by-zero guard on constant features - Unify prediction timestamps to ISO 8601 UTC - Open-Meteo: fetch 336+seq+h+72h history; populate future_exogenous from real forecast rows; NaN-guard the ratio window (503 rather than serve garbage) - Factor shared ratio transform used by both Firebase and Open-Meteo paths - Firebase: fetch full rolling-median window; schema confirmed against live record - Comment out user-input overri…069300f