Expand description
Calibration parameter tables for decision models (System One P0.3/P2.2).
One row holds the post-hoc calibration parameters for a single decision
primitive (noul/choice/score) of one decision schema on one model,
keyed by the (schema_id, model_id, calib_version) version triple:
- per-primitive temperature,
- null-state (content-free) bias vector,
- optional Dirichlet-calibration params for high-cardinality choice,
- conformal quantiles per primitive — score uses ordinal contiguous-interval params, noul/choice use APS/RAPS-style quantiles.
Rows are append-only: a calibration re-fit mints a NEW calib_version row
and never updates in place, so every past fit stays queryable and serving
can pin an exact triple.
Structs§
- Calibration
Params - One calibration parameter row.
- Calibration
Store - Calibration parameter store over any
StorageBackend: the writer API for the P2.2 re-fit loop and the reader API for serving. - Conformal
Quantile - One coverage level → nonconformity quantile (APS/RAPS-style).
- Dirichlet
Params - Dirichlet-calibration parameters (Kull et al. 2019) for high-cardinality
choice questions, where scalar temperature underfits: calibrated log-probs
are
W · ln(p) + bwithweightsrow-major K×K andbiasof length K. - Ordinal
Interval - One coverage level → ordinal contiguous interval half-widths, in level units, applied around the predicted level (min-CPS / RPS-based nonconformity for the score primitive).
- Version
Triple - The (schema, model, calib) version triple keying every calibration row.
Enums§
- Conformal
Params - Conformal parameters for one primitive. Score questions are ordinal, so their prediction sets are contiguous intervals; noul/choice use APS/RAPS-style quantiles.
- Decision
Primitive - Decision primitive a calibration row applies to (jev-1 profile superset).
Constants§
- CALIBRATION_
TABLE - Calibration parameter table name.
Functions§
- calibration_
params_ schema - Arrow schema of the
calibration_paramstable. Vector/composite params are stored as JSON in nullable VARCHAR columns (the crate’s existing convention for composite values, queryable via DuckDB JSON functions). - mint_
calib_ version - Mint a new calibration version id. Re-fits call this (or supply their own) and insert a new row; existing rows are never mutated.
- params_
from_ row - Decode one calibration row from a query result batch.
- params_
to_ record_ batch - Build the one-row RecordBatch for a calibration insert.