reach.diff¶
A/B evaluation diffing between two arms against calibrated noise floors.
Cross two recorded evaluation arms and statistically test performance deltas.
Arm ¶
Bases: BaseModel
Hold a single experimental arm and its associated Artifact.
Source code in src/reach/diff.py
ArmSummary ¶
Bases: BaseModel
Summarize provenance digests, catalog sizes, and accuracy metrics for an arm.
Source code in src/reach/diff.py
Comparison ¶
Bases: BaseModel
Hold diff analysis between two arms across headline, skill, and query levels.
Source code in src/reach/diff.py
separated
property
¶
separated: tuple[QueryDelta, ...]
Return queries whose intervals showed significant divergence.
verdict
property
¶
Generate a concise headline summary verdict string for the comparison.
Corroboration ¶
Bases: BaseModel
Record verification status of provenance changes between arms.
Source code in src/reach/diff.py
Headline ¶
Bases: BaseModel
Summarize run-wide top-1 accuracy change and noise floor significance.
Source code in src/reach/diff.py
QueryDelta ¶
Bases: BaseModel
Record per-query hit rate differences and overlap significance between arms.
Source code in src/reach/diff.py
SkillDelta ¶
Bases: BaseModel
Record per-skill recall differences and overlap significance between arms.
Source code in src/reach/diff.py
Survey ¶
Bases: BaseModel
Survey and validate readiness of two runs for pairwise diff comparison.
Source code in src/reach/diff.py
cross ¶
cross(
*,
confidence: float = DEFAULT_CONFIDENCE,
noise_inflation: float = NOISE_INFLATION,
settings: DiffSettings | None = None,
) -> Comparison
Perform comparison across validated arms, raising error if barriers exist.
Source code in src/reach/diff.py
VaryFactor ¶
Wall ¶
Bases: BaseModel
Represent an incompatibility barrier preventing comparison between two runs.
Source code in src/reach/diff.py
diff_arms ¶
diff_arms(
control: Arm,
treatment: Arm,
factor: VaryFactor | str,
*,
confidence: float = DEFAULT_CONFIDENCE,
noise_inflation: float = NOISE_INFLATION,
settings: DiffSettings | None = None,
) -> Comparison
Compare two experimental arms across the specified variation factor.
Source code in src/reach/diff.py
diff_runs ¶
diff_runs(
control_path: Path | str,
treatment_path: Path | str,
factor: VaryFactor | str,
*,
queries_root: Path | str | None = None,
control_corpus: Path | str | None = None,
treatment_corpus: Path | str | None = None,
control_label: str | None = None,
treatment_label: str | None = None,
queries: Path | str | None = None,
filter_skill: Sequence[str] = (),
filter_id: Sequence[str] = (),
confidence: float = DEFAULT_CONFIDENCE,
noise_inflation: float = NOISE_INFLATION,
) -> Comparison
Load and execute comparison between two results files across a factor.
Source code in src/reach/diff.py
load_arm ¶
load_arm(
results_path: Path | str,
*,
queries_root: Path | str | None = None,
corpus: Path | str | None = None,
label: str | None = None,
queries: Path | str | None = None,
filter_skill: Sequence[str] = (),
filter_id: Sequence[str] = (),
) -> Arm
Load results and reconstruct the Artifact model for an experimental arm.
Source code in src/reach/diff.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 | |
noise_floor ¶
noise_floor(
control: float,
treatment: float,
confidence: float = DEFAULT_CONFIDENCE,
noise_inflation: float = NOISE_INFLATION,
) -> float
Calculate minimum top-1 delta distinguishable from noise at confidence.
Source code in src/reach/diff.py
pairing_walls ¶
Identify structural barriers preventing comparison between two loaded arms.
Source code in src/reach/diff.py
probes_to_resolve ¶
Calculate required probes per arm to reliably detect a given accuracy delta.
Source code in src/reach/diff.py
survey_runs ¶
survey_runs(
control_path: Path | str,
treatment_path: Path | str,
factor: VaryFactor | str,
*,
queries_root: Path | str | None = None,
control_corpus: Path | str | None = None,
treatment_corpus: Path | str | None = None,
control_label: str | None = None,
treatment_label: str | None = None,
queries: Path | str | None = None,
filter_skill: Sequence[str] = (),
filter_id: Sequence[str] = (),
) -> Survey
Survey and validate two run paths against all comparative requirements.