Step 5: pre-training on the rules' outputs (pretrain.py, m2.py --pretrain); regressions as detectors/bench/compare.py; the reader from the tools repository

The detectors were simplified on 2026-11-16: the reader moved to aimsight-tools (scripts/data.py, put on the path by
categories.py) and a regression is now a Total losing more than 1 point, or a family of a station losing more than
5 points and more than 20 instants.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 09:51:56 +01:00
1 parent 7312a1c3ca
commit 5337dd0dac
6 files changed
+147 -51

No files matched your search

+5 -2
View File
@@ -13,7 +13,10 @@ y[1:, 1] = 1
y[2, 0] = 1
c = evaluate.counts(y, yhat)
assert c == {"Visibility": [1, 1, 0], "Obstruction": [2, 2, 2]}, c
assert evaluate.regressions({"Obstruction": [10, 10, 5]}, {"Obstruction": [10, 4, 4]}) == [("Obstruction", "found", 50, 40)]
assert evaluate.regressions({"Obstruction": [10, 10, 5]}, {"Obstruction": [10, 10, 5]}) == []
assert evaluate.regressions({"Obstruction": [100, 100, 50]}, {"Obstruction": [100, 30, 30]}) == [] # 20 instants: not more
assert evaluate.regressions({"Obstruction": [100, 100, 50]}, {"Obstruction": [100, 29, 29]}) == [("Obstruction", "found", 50, 29, 21)]
assert evaluate.regressions({"Obstruction": [10, 10, 5]}, {"Obstruction": [10, 4, 4]}) == [] # 10 points, 1 instant: noise
assert evaluate.regressions({"Obstruction": [10, 10, 5]}, {"Obstruction": [10, 4, 4]}, whole=True) == [("Obstruction", "found", 50, 40, 1)]
assert evaluate.regressions({"Visibility": [100, 50, 50]}, {"Visibility": [100, 100, 71]}) == [("Visibility", "correct", 100, 71, 29)]
assert evaluate.regressions({"Obstruction": [0, 15, 0]}, {}) == [] # false alarms gone: not a regression
print("ok")