Detector-learner: shorter benchmark per station, work folders, grouped comparisons, control journal at base

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-05 13:35:56 +01:00
1 parent 633493b00a
commit 1ced7667b1
6 files changed
+16 -13

No files matched your search

@@ -6,7 +6,7 @@ famille, qui dit si les détecteurs font globalement mieux d'une séance à l'au
son score ; les autres blocs, la non-régression : une famille qui recule sur une station est un recul, même si le total
monte. Avec --etape, chaque ligne (stations et Total) entre dans l'historique, detector-learner/historique.csv, avec la
version des détecteurs (score.version()).
Usage : python3 .claude/skills/detector-learner/regression.py [--seance <séance> --etape <étape>]
Usage : python3 .claude/skills/detector-learner/regression.py [--seance <séance> --etape <étape>] [--stations A,B]
"""
import argparse
import csv
@@ -16,7 +16,7 @@ import os
import sys
from datetime import datetime, timezone
RACINE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..")
RACINE = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", ".."))
import score # noqa: E402 (à côté)
HISTORIQUE = os.path.join(RACINE, "detector-learner", "historique.csv")
@@ -37,10 +37,13 @@ if __name__ == "__main__":
p = argparse.ArgumentParser(usage=__doc__)
p.add_argument("--seance", default="")
p.add_argument("--etape")
p.add_argument("--stations", help="A,B : ces stations seules, sans historique (un essai plus court)")
a = p.parse_args()
total, res = {}, {}
for chemin in sorted(glob.glob(os.path.join(RACINE, "labeling", "auto", "*.jsonl"))):
station = os.path.basename(chemin)[:-len(".jsonl")]
if a.stations and station not in a.stations.split(","):
continue
dossier = os.path.join(RACINE, "data", station)
if not os.path.isdir(dossier):
print(f"{station} : pas de data/{station}/, sautée\n")
@@ -53,7 +56,7 @@ if __name__ == "__main__":
for k, v in n.items():
total[k] = [a + b for a, b in zip(total.get(k, [0, 0, 0]), v)]
score.afficher("Total", total)
if a.etape:
if a.etape and not a.stations:
res["Total"] = total
os.makedirs(os.path.dirname(HISTORIQUE), exist_ok=True)
neuf = not os.path.exists(HISTORIQUE)
+1 -1
View File
@@ -27,7 +27,7 @@ import sys
from datetime import timedelta
from pathlib import Path
RACINE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", "..")
RACINE = os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "..", ".."))
sys.path.insert(0, os.path.join(RACINE, "detectors"))
sys.path.insert(0, os.path.join(RACINE, ".claude", "skills", "analyser-lot"))
import categories # noqa: E402 (il met lui-même agent-tools sur le chemin)