Repository navigation
Decision evaluations: pre-computed predictions, oracle labels, and 1-D sweep - #9
Draft
jeremy-wayland wants to merge 16 commits into
Draft
jeremy-wayland wants to merge 16 commits into
jeremy-wayland wants to merge 16 commits into
Conversation
Every evaluation x frame now holds (variant_name, source_row_id) next to the features, so models other than ONNX can look rows up by key. The key is defined once as layout::ROW_KEY_COLS. ONNX models still select by feature_order; a golden test pins evaluate/compare output on the CLI fixtures to what main produced before this change. EvaluationResult gains empty `oracle` and `sweep` slots (skipped when None) for the decision-model work in #8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SweepSimulator sets one feature at a time to each value of a grid, copying the rest of the row; prefixed sweep_* meta columns. The metrics (boundary_offset, monotonic_rate, never_flipped, extra_flips_rate, accuracy_by_step) fill EvaluationResult.sweep, descriptively until oracle labels are available. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--oracle-labels <parquet> on evaluate and compare replaces every variant's y, clean included, with the oracle's label for the same (variant_name, source_row_id); a row it does not cover is an error. The run is flagged through EvaluationConfig.oracle, and core/src/evaluate/oracle.rs fills EvaluationResult.oracle: accuracy per variant, jitter flips split by whether the oracle changed (binary included), flipper boundary_error against oracle_flip_t, and, with --abstain-class, blackout abstention and its confusion counts. Without the flag the output is unchanged (golden test). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds `--predictions [NAME=]PATH` to `evaluate` (exclusive with --model) and `compare` (repeatable, mixes with --model). A PrecomputedPredictions model serves rows by (variant_name, source_row_id) and errors on any missing row, duplicate row, null value or width mismatch. compare, evaluate and the predictions table now take Box<dyn Model> plus label and output names; ONNX output is unchanged (golden passes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Oracle files are built from compare --predictions-out, so expectations follow the fixture models' actual decisions: jitter with and without label changes, flipper boundary_error against an oracle that flips at a known step, multiclass abstention on blackout, and the missing-row and unknown-abstain-class errors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
simulate --sweep feature[=cutoff] (repeatable) with --sweep-range, --sweep-relative-to, --sweep-steps and --sweep-near writes sim/sweep/sweep.parquet, ids sweep_<case>_<feature>_step_<n>. evaluate sweep treats the grid like flipper's (meta columns are not features, placeholder labels) and fills the sweep section; regression is refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --oracle-labels every variant's y holds the oracle's labels, so the sweep metrics now read the grid's y as the oracle. Adds an end-to-end test: simulate --sweep, precomputed perfect/constant/shifted predictions and an oracle into compare, plus multiclass with --abstain-class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t detail (#10) - Sweep `Spread` quartiles use the oracle flipper's linear-interpolation quantile (numpy's default) instead of nearest rank. - With oracle labels, flipper and sweep predictions are shared with oracle scoring rather than predicted twice. - `Evaluator::run` errors when more than one dataset has sweep or oracle results, instead of reporting one picked in HashMap order. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends Pasteur to evaluate non-ONNX predictors and perturbations that change the ground-truth clinical decision:
--predictions):evaluateandcompareaccept local parquet/CSV prediction tables alongside or instead of--model, enabling side-by-side comparison of ONNX models, Python predictors, and rule engines on identical simulated rows.--oracle-labels) & abstention (--abstain-class): Scores models against per-(variant, row) ground-truth labels (oracle.accuracy,oracle.jitterpreserved vs. changed flip rates,oracle.flipperboundary error, andoracle.abstainblackout confusion matrix).--sweep-features,evaluate/compare sweep): Simulates 1-D grids across clinical cutoffs while holding other features fixed (sweep/sweep.parquet), and reports monotonic rate, boundary offset (median,q25,q75),never_flipped,extra_flips_rate,model_flip_value, and step-by-step accuracy.evaluateandcompareoutputs across all 12(task × sim_type)combinations.Verification
cargo fmt --all --checkcargo clippy --workspace --locked -- -D warningscargo test --workspace --locked --exclude pypasteur-bindings