feat: per-sensor holdout metrics and small-model confusion matrix

- train.py emits per-sensor MAE/WAPE/R2 vs the seasonal-naive baseline
- small.py emits the full confusion matrix and per-sensor classifier metrics
- metrics.json now carries the small-model summary for paper support
- regenerate baked artifacts; tests assert the tables are internally consistent
This commit is contained in:
Noel Sabia committed 2026-11-14 06:35:14 +01:00
1 parent 4ea7212b70
commit 000aaed7a5
8 files changed
+386 -10

No files matched your search

+87 -3
View File
@@ -1,6 +1,6 @@
{
"model_version": "logit-20261114-040339",
"trained_at": "2026-11-14T04:03:39Z",
"model_version": "logit-20261114-052723",
"trained_at": "2026-11-14T05:27:23Z",
"features": [
"hour",
"weekday",
@@ -33,5 +33,89 @@
"n_test": 5710,
"positive_rate": 0.202,
"sensors": 8
}
},
"confusion_matrix": {
"labels": {
"0": "not busy",
"1": "busy"
},
"tn": 3377,
"fp": 1178,
"fn": 492,
"tp": 663
},
"per_sensor": [
{
"sensor": "density-01",
"n": 714,
"positive_rate": 0.111,
"accuracy": 0.761,
"precision": 0.3,
"recall": 0.873,
"f1": 0.447
},
{
"sensor": "hn-goetzentuem-01",
"n": 714,
"positive_rate": 0.197,
"accuracy": 0.732,
"precision": 0.391,
"recall": 0.638,
"f1": 0.485
},
{
"sensor": "hn-hagenbuchersee-01",
"n": 714,
"positive_rate": 0.049,
"accuracy": 0.724,
"precision": 0.148,
"recall": 0.971,
"f1": 0.257
},
{
"sensor": "hn-hagenbuchersee-02",
"n": 714,
"positive_rate": 0.123,
"accuracy": 0.783,
"precision": 0.355,
"recall": 0.932,
"f1": 0.514
},
{
"sensor": "hn-marahaus-01",
"n": 714,
"positive_rate": 0.055,
"accuracy": 0.71,
"precision": 0.135,
"recall": 0.795,
"f1": 0.23
},
{
"sensor": "hn-neckarufer-01",
"n": 713,
"positive_rate": 0.09,
"accuracy": 0.764,
"precision": 0.274,
"recall": 0.984,
"f1": 0.429
},
{
"sensor": "hn-soleo-01",
"n": 714,
"positive_rate": 0.704,
"accuracy": 0.581,
"precision": 0.943,
"recall": 0.431,
"f1": 0.592
},
{
"sensor": "hn-stadtgalerie-01",
"n": 713,
"positive_rate": 0.289,
"accuracy": 0.604,
"precision": 0.335,
"recall": 0.374,
"f1": 0.353
}
]
}