Datasets:
Download scripts/render_tables.py from Cross-Mergeability/crossarch-accuracy: direct link, hf CLI and curl.
- Browser
- Download file 1.68 kB
-
https://huggingface.co/datasets/Cross-Mergeability/crossarch-accuracy/resolve/main/scripts/render_tables.py
- Command line
-
hf download hf://datasets/Cross-Mergeability/crossarch-accuracy/scripts/render_tables.py
-
curl -L -o render_tables.py https://huggingface.co/datasets/Cross-Mergeability/crossarch-accuracy/resolve/main/scripts/render_tables.py
1.68 kB
| """Render Table 1 as markdown.""" | |
| import pandas as pd, numpy as np, json, sys | |
| ROOT = "/root/crossarch-accuracy" | |
| df = pd.read_csv(f"{ROOT}/results/table1_checkpoint_accuracy.csv") | |
| df = df.sort_values(["family", "log10_step_ratio"]) | |
| lines = [] | |
| lines.append("| pair | Δ decades | CKA | LMC barrier (nats) | acc A | acc B | acc naive merge | " | |
| "acc barrier (pts) | Δ vs better parent (pts) | beats better parent? |") | |
| lines.append("|---|---|---|---|---|---|---|---|---|---|") | |
| for fam, g in df.groupby("family"): | |
| lines.append(f"| **{fam}** | | | | | | | | | |") | |
| for _, r in g.iterrows(): | |
| lines.append("| {p} | {d:.2f} | {c:.3f} | {b:+.3f} | {a:.3f} | {bb:.3f} | {m:.3f} | " | |
| "{ab:+.1f} | {dv:+.1f} | {w} |".format( | |
| p=r.pair, d=r.log10_step_ratio, c=r.cka, b=r.barrier, | |
| a=r.acc_a, bb=r.acc_b, m=r.acc_naive, | |
| ab=100 * r.acc_barrier, dv=100 * r.d_acc_vs_better, | |
| w="**yes**" if r.beats_better_parent else "no")) | |
| md = "\n".join(lines) | |
| open(f"{ROOT}/results/table1_checkpoint_accuracy.md", "w").write( | |
| "# Table 1 — checkpoint merging in accuracy space\n\n" | |
| "`acc` = macro-average of ARC-Easy, SciQ, PIQA, LAMBADA (pooled chance 0.25).\n" | |
| "`acc barrier` = mean(acc A, acc B) − acc(merge), in accuracy points; the sign-matched\n" | |
| "accuracy analogue of the nats LMC barrier (positive = merge worse than the endpoint average).\n" | |
| "`Δ vs better parent` = acc(merge) − max(acc A, acc B), in points; **this is the column that\n" | |
| "decides usability**.\n\n" + md + "\n") | |
| print(md[:4000]) | |
| print("\nrows:", len(df)) | |