Skip to content

Latest commit

 

History

History
187 lines (153 loc) · 5.99 KB

outputs.rst

File metadata and controls

187 lines (153 loc) · 5.99 KB

Output Layout

Simulation bundle

output/
├── README.md              # only after `pasteur-cli card`
├── clean/
│   └── clean.parquet
├── blackout/
│   └── blackout.parquet
├── jitter/
│   ├── jitter_0.parquet
│   └── jitter_1.parquet
├── flipper/
│   └── flipper.parquet
├── sweep/
│   └── sweep.parquet
├── scramble/              # only with --scramble-rate
│   └── scramble.parquet
├── units/                 # only with --unit-rate
│   └── units.parquet
└── site/                  # only with --site
    └── site.parquet       # or site_0.parquet ... with --site-draws

Every simulation parquet includes:

Column Type Meaning
source_row_id string Original row ID, or a synthetic flipper path ID
row_ordinal u32 Clean-run row position
Feature columns numeric Model inputs carried from or derived from the source cohort. In scramble.parquet the --feature column is text, as is every feature a site file scrambles

Flipper metadata

Flipper output also contains pair_id, step, t, source_a_row, source_b_row, label_a, and label_b. Grids simulated with --task multilabel also contain pair_label, the index of the label the pair was sampled for. For multiclass grids label_a and label_b are class indices in --positive-group-id order. For regression grids they are the two patients' true target values, one below the --flip-threshold cutoff and one at or above it. Evaluation strips these metadata columns before model scoring.

Sweep metadata

Sweep output (written when simulate receives --sweep) also contains sweep_case_row (the clean row each path starts from), sweep_feature, sweep_cutoff (nullable), sweep_step, and sweep_value. source_row_id is formatted as sweep_<case id>_<feature>_step_<n>.

Evaluation JSON

evaluate writes an EvaluationResult:

{
  "baselines": {"roc_auc": 0.85},
  "evaluations": {
    "metric_invariant": {
      "jitter_stability": 0.92,
      "flipper_stability": null
    },
    "metric_based": {
      "roc_auc": {
        "resiliency": 0.88,
        "generalizability": 1.0
      }
    }
  },
  "created_at": "2026-07-10T12:00:00Z"
}

flipper_stability is populated for flipper evaluation and null for other runs.

parse_loss counts values that were present in the stress variant but became null when cast to numbers for scoring, beyond what the clean variant already loses in the same column, as {variant: {column: count}}. A text column that is text in clean too (say, site) is not counted. It is omitted when nothing was lost. This is silent missingness: a scramble run with high parse loss is close to a blackout run.

"parse_loss": {"scramble": {"glucose": 41}}

Classifier results that loaded a stress variant (blackout, scramble, units or site) add a stress array, one entry per variant, or per site draw; :doc:`metrics` defines each field. silent_change_rate appears only with --abstain-class. With site draws, generalizability is the lowest resiliency in this array.

"stress": [
  {"variant": "site_0", "roc_auc": 0.84, "resiliency": 0.99,
   "rows": 300, "rows_changed": 112, "decisions_changed": 4,
   "decision_change_rate": 0.036},
  {"variant": "site_1", "roc_auc": 0.71, "resiliency": 0.84,
   "rows": 300, "rows_changed": 300, "decisions_changed": 57,
   "decision_change_rate": 0.19}
]

Multiclass and multilabel results add a multi object. The headline fields above hold macro averages; :doc:`metrics` defines each field.

"multi": {
  "task": "multilabel",
  "roc_auc_micro": 0.93,
  "worst_label_resiliency": 0.81,
  "decision_flip_rate": 0.06,
  "flipper_never_flipped": 0.37,
  "excluded_labels": [],
  "per_label": [
    {"label": "diabetes", "roc_auc": 0.90, "resiliency": 0.81,
     "jitter_stability": 0.95, "flipper_stability": 0.63}
  ]
}

Multiclass results also carry flipper_detour_rate.

Regression results key baselines by rmse, mae and r2, key metric_based by r2, and add a regression object in the target's units (see :doc:`metrics`):

"regression": {
  "target": "hba1c",
  "n_rows": 300,
  "target_sd": 1.07,
  "blackout_rmse": 0.42,
  "blackout_r2": 0.85,
  "jitter_prediction_sd": 0.05,
  "flip_threshold": 6.5,
  "flipper_never_flipped": 0.23
}

Fields for simulation types that were not loaded are null. blackout_rmse and blackout_r2 keep their names for compatibility but hold whichever stress variant was loaded: blackout, scramble, or units.

When --oracle-labels is supplied, EvaluationResult adds an oracle object with per-variant exact-match accuracy and variant-specific jitter, flipper, and abstain sections. Evaluating the sweep simulation type adds a sweep array with one entry per swept feature. See :doc:`metrics` for field definitions.

Comparison predictions

When compare receives --predictions-out, the parquet contains:

  • source_row_id
  • variant_name
  • label (multi-output: label__<class> per class; regression: target, the true value, null on synthetic flipper rows)
  • one floating-point probability column per model (multi-output: <model>__<class> per class; regression: the predicted value)
  • all_agree (regression: same side of --flip-threshold, null without one)

The model column name is derived from the model file stem.