Files
Volve-DIA/scripts/13_m34_report.py
lamlvh 59fa1f4d08 Add M3-M4 baselines, C4 comparison and G2 report
Frozen feature tables for T1-T3, TF-IDF + logistic regression and DistilBERT
baselines with grouped splits, T4/C4 question answering (zero-shot, few-shot,
RAG, tool_only, agent), Qwen zero-shot T2, paired well-cluster bootstrap and
the G2 coverage report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 07:00:36 +00:00

28 lines
935 B
Python
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env python3
"""Build current M3–M4 tables and a G2 coverage report from saved predictions."""
import fcntl
import pandas as pd
from volve_dia import m2, m34
from volve_dia.m34_report import build_report
def main():
protocol, _ = m34.configuration()
root, digests = m34.inputs(protocol)
out = root / "m34"
with (out / "report.lock").open("a") as lock:
fcntl.flock(lock, fcntl.LOCK_EX)
report = build_report(out, root, protocol, digests)
for name in ("classification", "classification_contrasts", "qa", "qa_contrasts", "qa_coverage"):
data = pd.json_normalize(report[name])
m34.atomic_write(out / f"{name}.csv", data.to_csv(index=False).encode())
m2.write_json(out / "report.json", report)
print(f"G2 passed: v1 {report['g2']['passed']}, v2 {report['g2_v2']['passed']}. T4 C4 coverage: {report['c4']}")
if __name__ == "__main__":
main()