Skip to content

Decision evaluations: pre-computed predictions, oracle labels, and 1-D sweep - #9

Draft
jeremy-wayland wants to merge 16 commits into
mainfrom
decision-evals
Draft

jeremy-wayland wants to merge 16 commits into
mainfrom
decision-evals

Conversation

@jeremy-wayland

Copy link
Copy Markdown
Member

Summary

Extends Pasteur to evaluate non-ONNX predictors and perturbations that change the ground-truth clinical decision:

  • Pre-computed predictions (--predictions): evaluate and compare accept 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.
  • Per-row oracle labels (--oracle-labels) & abstention (--abstain-class): Scores models against per-(variant, row) ground-truth labels (oracle.accuracy, oracle.jitter preserved vs. changed flip rates, oracle.flipper boundary error, and oracle.abstain blackout confusion matrix).
  • 1-D feature sweep (--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.
  • Golden regression test: Pins byte-exact evaluate and compare outputs across all 12 (task × sim_type) combinations.

Verification

  • cargo fmt --all --check
  • cargo clippy --workspace --locked -- -D warnings
  • cargo test --workspace --locked --exclude pypasteur-bindings

jeremy-wayland and others added 14 commits October 29, 2026 09:08
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>
jeremy-wayland and others added 2 commits October 30, 2026 13:42
…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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant