Results
The result objects twin operations hand back.
SampleDraws
Raw joint posterior draws from twin.sample(), columnar on the wire.
n
int
Draws per sampling unit.
raw
dict
The payload as it came off the wire.
Properties
environments (
list[str])
SampleDraws.to_frame
SampleDraws.to_frame() -> pd.DataFrameUndocumented; the signature above is the contract.
SimulationResult
A completed simulation run: raw outputs plus best-effort tabular and narrative views.
run_id
str
The run this result came from.
run
dict
The run document: status, timings, and the rest.
scenario
dict | None
The scenario that ran.
Properties
results (
Any)environment_groups (
list[dict[str, Any]]): The saved environment groups this run was scoped to, as the platform froze them.summary (
str)tables (
list[str])
SimulationResult.to_frame
Tabularize the result payload.
Simulation families answer with different shapes, so this finds record lists in the payload.
path
str | None
None
Which candidate table to use, as a dotted path. With several candidates and no path, the largest wins; the error message from a bad path lists what exists.
Returns (pd.DataFrame): The chosen records as a DataFrame.
Raises
InvalidArgumentError: No tabular records in the payload, or no records atpath.
SimulationResult.link
This run's detail view on the platform, as a clickable URL.
Opens the parent twin's Simulate tab on exactly this run.
SimulationResult.export
The platform's own export of the run.
fmt
str
'csv'
Export format, for example csv.
Returns (bytes): The export's raw bytes.
SimulationResult.sweep
Full dose-response curve of a range intervention, one metric at a time.
metric
str | None
None
Which metric's curve to return. Required when the run carries several; the error names them.
Returns (SweepResult): The curve as a SweepResult: displayed in a notebook it renders the interactive curve, to_frame() is the points, and DataFrame attributes pass through.
SweepResult
One metric's dose-response curve off a sweep run.
Displayed in a notebook it mounts the interactive curve; everywhere else it behaves like its DataFrame — to_frame() returns the points, and unknown attributes (head, plot, …) delegate to it.
metric
str
The metric this curve measures.
Properties
swept_variable (
str | None)
SweepResult.to_frame
Undocumented; the signature above is the contract.
ForecastResult
Forecast run with a tidy long-format frame: environment, series, timestamp, values.
Everything on SimulationResult applies; to_frame() additionally carries an environment column on panel runs and a variable column when several targets were forecast, so no series is ever dropped.
ForecastResult.to_frame
Undocumented; the signature above is the contract.
PredictionResult
Prediction run: one row per input record, per target.
Everything on SimulationResult applies. to_frame() adds a row column carrying the 0-based position of the input record each prediction answers for, so predictions join back onto the frame they were asked about; a variable column names the target when several were predicted, and an environment column the environment on a panel twin.
PredictionResult.to_frame
Undocumented; the signature above is the contract.
UpdateResult
Outcome of an incremental model update (assimilation).
status
str
committed, up_to_date, or retrain_required.
rows_assimilated
int | None
Rows folded into the model, when any.
reasons
list[str]
Why assimilation was not possible, when it was not.
job
dict
The underlying job document.
Properties
retrain_required (
bool)
ScoreResult
Verdicts and per-row counterfactual changes from a batch scoring run.
run_id
str
The simulation run underneath.
Properties
digest (
dict[str, Any]): Verdict counts, top drivers, and the first row summaries.
ScoreResult.to_frame
Every scored row with its full change list, paged transparently.
max_rows
int | None
None
Stop after this many rows. Fetches everything when omitted.
Returns (pd.DataFrame): One row per scored input, with its change list.
ScoreResult.link
This scoring run's detail view on the platform, as a clickable URL.
Last updated

