CLI Reference¶
pasteur-cli performs local simulation, evaluation, comparison, dataset-card
generation, and staging-cache management.
simulate¶
pasteur-cli simulate [OPTIONS] --input <INPUT>
Important options:
Option |
Default |
Purpose |
|---|---|---|
|
required |
Local clean parquet |
|
none |
Cohort-membership parquet; enables flipper (classifiers) |
|
none |
Regression: targets parquet and its target column |
|
|
Regression: ID column of |
|
|
Simulation bundle root |
|
|
Source row identifier |
|
|
Feature targeted by blackout and jitter |
|
none |
Repeatable column nulled with the target feature |
|
|
Fraction of rows selected for blackout |
|
|
Noise scale |
|
|
Number of jitter variants |
|
|
Group treated as the positive cohort. Repeat once per class or label
for |
|
|
|
|
none |
Regression only: clinical cutoff, in target units, that flipper pairs are sampled across. Without it, regression skips flipper |
|
|
Opposite-label patient pairs to sample for flipper |
|
|
Interpolation steps per flipper pair |
|
|
Random seed |
The defaults for --id-col, --feature, and --positive-group-id
come from the example thyroid dataset. Always pass them for your own data.
--jitter-scale is in units of the feature’s standard deviation.
card¶
Generate a Hugging Face-compatible README.md for a local bundle:
pasteur-cli card \
--input ./output \
--source-dataset org/source \
--dest-repo org/source-simulations \
--source-info source-info.json
The command writes documentation only. Uploads remain explicit hf upload
operations outside Pasteur.
evaluate¶
Score one local ONNX model:
pasteur-cli evaluate blackout \
--sim-root ./sim \
--labels ./labels/groups.parquet \
--model ./models/model.onnx \
--output ./scores.json
The positional simulation type can be blackout, jitter, or flipper.
Each run loads only that folder; see Reading the results for which metric to read
from each.
Option |
Default |
Purpose |
|---|---|---|
|
required |
Bundle written by |
|
classifiers |
Cohort-membership parquet (see Data Contracts) |
|
regression |
Targets parquet and its target column (see Data Contracts) |
|
|
ID column of |
|
required |
Local |
|
|
Group treated as the positive cohort. Repeat once per model output,
in |
|
|
Must match the model’s |
|
next to model |
Path to |
|
|
Name of the model’s input tensor |
|
see below |
Value sent to the model for missing inputs |
|
|
Binary only: column of the probability output that is the positive class. Rejected for multiclass, multilabel and regression models |
|
|
Decision threshold used by flipper stability. Multilabel: applies to
labels without a contract threshold. Unused for multiclass (argmax).
Regression: the clinical cutoff in target units, with no default;
required for |
|
stdout |
Write the JSON result to a file. The directory must already exist. |
compare¶
Score multiple models over the same variants:
pasteur-cli compare blackout \
--sim-root ./sim \
--labels ./labels/groups.parquet \
--model ./models/a.onnx \
--model ./models/b.onnx \
--predictions-out ./predictions/blackout.parquet \
--output ./comparison.json
compare takes the same options as evaluate. --model is repeatable.
Models are labelled by file name, so give each one a different name
(a.onnx, b.onnx); two files both called model.onnx collide.
--predictions-out writes one probability column per model plus
all_agree. A single --contract applies to every model.
For a multiclass or multilabel model, pass the task and one group per output:
pasteur-cli simulate --input ./clean.parquet --output ./sim \
--labels ./labels/groups.parquet --task multiclass \
--positive-group-id 1 --positive-group-id 2 --positive-group-id 3
pasteur-cli evaluate flipper --sim-root ./sim \
--labels ./labels/groups.parquet --model ./models/model.onnx \
--task multiclass \
--positive-group-id 1 --positive-group-id 2 --positive-group-id 3
The model’s metadata.json must declare task_type and
output.classes; see Data Contracts.
For a regression model, pass the targets instead of cohorts, and the clinical cutoff for flipper to both commands:
pasteur-cli simulate --input ./clean.parquet --output ./sim \
--task regression --targets ./targets.parquet --target-col hba1c \
--flip-threshold 6.5
pasteur-cli evaluate flipper --sim-root ./sim \
--task regression --targets ./targets.parquet --target-col hba1c \
--flip-threshold 6.5 --model ./models/model.onnx
--predictions-out then writes target and one prediction column per
model. all_agree is true when every model puts the patient on the same
side of the cutoff, and null when no --flip-threshold is given.
cache¶
The Pasteur staging cache is separate from the Hugging Face download cache:
pasteur-cli cache list
pasteur-cli cache rm stub.onnx --kind models
pasteur-cli cache clear --kind simulations
Use pasteur-cli cache for Pasteur’s models/ and simulations/
staging directories. Use hf cache for files downloaded from the Hub.
Model contracts¶
An optional metadata.json preserves feature order and the model’s missing
value sentinel:
{
"input": {
"feature_order": ["TSH", "T3", "T4"],
"absent_sentinel": 0.0
}
}
--null-fill resolves in this order: the flag, then the contract’s
absent_sentinel, then NaN. A model that returns NaN probabilities is
rejected with an error rather than scored.
A declared feature-order mismatch aborts evaluation. If no contract exists, Pasteur still checks input width, but it cannot infer feature semantics from the ONNX graph.
Run pasteur-cli <command> --help for the complete generated option list.