| #!/usr/bin/env python3 | |
| """Checks for the ten-dataset ridge sensitivity reproduction.""" | |
| from __future__ import annotations | |
| import json | |
| from pathlib import Path | |
| import numpy as np | |
| import pandas as pd | |
| ROOT = Path(__file__).resolve().parent | |
| OUT = ROOT / "results" / "real_table2_cpu" | |
| def main() -> None: | |
| raw = pd.read_csv(OUT / "raw_results.csv") | |
| summary = pd.read_csv(OUT / "summary.csv") | |
| report = json.loads((OUT / "verification.json").read_text()) | |
| assert len(raw) == 50 | |
| assert len(summary) == 10 | |
| assert raw.groupby("dataset").seed.nunique().eq(5).all() | |
| assert report["included_meps"] and report["included_bio"] | |
| assert report["dataset_count"] == 10 and report["runs"] == 50 | |
| # This is a deliberately retained negative control: with a stronger Ridge | |
| # point predictor the length reduction is not universal. | |
| assert report["protocol"]["predictor"] == "ridge" | |
| assert report["pt_shorter_count"] == 6 | |
| assert np.isfinite(raw.select_dtypes(include="number").to_numpy()).all() | |
| assert np.allclose(summary.pt_length_mean, raw.groupby("dataset", sort=False).pt_length.mean().to_numpy()) | |
| assert np.allclose(summary.vcp_coverage_mean, raw.groupby("dataset", sort=False).vcp_coverage.mean().to_numpy()) | |
| assert abs(report["mean_vcp_coverage"] - 0.9) < 0.025 | |
| assert abs(report["mean_pt_coverage"] - 0.9) < 0.025 | |
| assert report["max_abs_mean_coverage_difference"] < 0.025 | |
| assert (OUT / "real_table2_cpu.png").stat().st_size > 40_000 | |
| print("PASS: ridge sensitivity control retained (6/10 shorter; nominal coverage)") | |
| if __name__ == "__main__": | |
| main() | |
Xet Storage Details
- Size:
- 1.62 kB
- Xet hash:
- ca7c59ecc54ae548f1746ffede4246813116aa1d254b867bfcbf963f5f164079
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.