MCPcopy Create free account
hub / github.com/FlashSampling/FlashSampling / print_results

Function print_results

benchmarking/vllm/judge_eval.py:70–92  ·  view source on GitHub ↗

Print per-variant accuracy with bootstrap CIs, and pairwise comparisons.

(all_results: dict[str, dict[int, bool]])

Source from the content-addressed store, hash-verified

68
69
70def print_results(all_results: dict[str, dict[int, bool]]):
71 """Print per-variant accuracy with bootstrap CIs, and pairwise comparisons."""
72 rng = np.random.default_rng(BOOTSTRAP_SEED)
73 names = list(all_results.keys())
74
75 # Per-variant accuracy + CI
76 for name in names:
77 by_doc = all_results[name]
78 correct = sum(by_doc.values())
79 total = len(by_doc)
80 arr = np.array(list(by_doc.values()), dtype=np.float64)
81 lo, hi = bootstrap_ci(arr, rng)
82 print(
83 f"{name}: {correct}/{total} correct ({100 * correct / total:.1f}%, 95% CI [{lo:.1f}%, {hi:.1f}%])"
84 )
85
86 # Pairwise paired bootstrap for each pair
87 if len(names) >= 2:
88 print()
89 for i in range(len(names)):
90 for j in range(i + 1, len(names)):
91 na, nb = names[i], names[j]
92 paired_bootstrap(all_results[na], all_results[nb], na, nb, rng)
93
94
95def bootstrap_ci(arr: np.ndarray, rng: np.random.Generator) -> tuple[float, float]:

Callers 1

mainFunction · 0.85

Calls 2

bootstrap_ciFunction · 0.85
paired_bootstrapFunction · 0.85

Tested by

no test coverage detected