校准漂移检测增加日志告警 + 更新架构文档
- core.py:drift.drifted=true 时输出 loguru warning,包含 delta% 和 sample 数量 - data-architecture-review.md:标记 2 项误诊(METAR TTL 实际 600s、轮询已有 AbortController 保护) - 剩余真正待办:校准自动重训练(需算力)、缓存键细化(低优先级)
This commit is contained in:
@@ -98,9 +98,9 @@ EMOS 线性回归校准 raw distribution,支持 `legacy` / `emos_shadow` / `em
|
|||||||
|
|
||||||
## 六、待办
|
## 六、待办
|
||||||
|
|
||||||
| # | 问题 | 优先级 |
|
| # | 问题 | 优先级 | 说明 |
|
||||||
|---|------|------|
|
|---|------|------|------|
|
||||||
| 1 | 校准系数需手动重新训练(数据分布变化时 CRPS 漂移) | 🟡 |
|
| 1 | 校准系数需手动重新训练 | 🟡 | 漂移检测已有,但自动触发重训练需要 GPU/算力资源 |
|
||||||
| 2 | METAR TTL 60s 过于激进 | 🟡 |
|
| 2 | 缓存键过粗 — `city::mode` 粒度 | 🟢 | 微小温度变化触发完整重算,可考虑内容 hash 键 |
|
||||||
| 3 | 缓存键过粗 — 微小变化触发完整重算 | 🟢 |
|
|
||||||
| 4 | 扫描终端 10min 轮询与 35s 超时可能堆积 pending 请求 | 🟢 |
|
> 注:原审查中 METAR TTL 60s 实际为 600s(误诊);扫描终端轮询已有 `AbortController` + `requestSeq` 保护(误诊)。
|
||||||
|
|||||||
@@ -508,6 +508,12 @@ def _probability_summary() -> Dict[str, Any]:
|
|||||||
records.append(rec)
|
records.append(rec)
|
||||||
if records:
|
if records:
|
||||||
drift = check_calibration_drift(records)
|
drift = check_calibration_drift(records)
|
||||||
|
if drift.get("drifted"):
|
||||||
|
logger.warning(
|
||||||
|
"Calibration drift detected: {} — {}",
|
||||||
|
drift.get("warning") or "CRPS degraded",
|
||||||
|
f"delta={drift.get('delta_pct')}% samples={drift.get('sample_count')}",
|
||||||
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user