> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canary.effectiveai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Result columns and statuses

> The columns of each table that rate and explain return, and the meaning of each status.

## `Program.rate` and `Market.rate`

One row per submission (a book) or context (a study), in input order. A market's rows follow
context order, then program order.

| Column | Present when | Holds |
| - | - | - |
| `submission_id` | Always | The submission |
| `scenario_id` | You rate a study | The scenario; `baseline` is the book as reported |
| `draw_id` | You rate a study | The draw; 0 is the scenario as reported |
| `program` | You rate a market | The program's name in the market |
| `status` | Always | One of the statuses below |
| `reason_code` | Always | The code of the first reason for a status other than `succeeded` |
| `reason` | Always | The message of that reason |
| `bundle_id` | Always | The rater's immutable identity; pass it as `revision` to rate again |
| One per outcome | The rater has it | The rater's outcome, named by its `RatingOutcomes`, as float64 |
| One per `read` key | The program has `read` | The column that the program's `read` returns, in place of the outcomes |

A row that has a status other than `succeeded` has `NaN` in each outcome column. A market's
program has `NaN` in each outcome column that its rater leaves out.

## `RatingResult.to_pandas`

One row per input to `Rater.rate`, in input order.

| Column | Holds |
| - | - |
| The identity key | The input's ID: the `Dataset` key, or `id` for a list position |
| `status` | One of the rater statuses below |
| `reason_code` | The code of the first reason for a status other than `succeeded` |
| `reason` | The message of that reason |
| One per outcome | The outcome's dotted path after the root record's name, as float64 |

`RatingResult.rows` holds the same rows with exact values: `Decimal` numbers, and
`{"$rational": "p/q"}` for a value with an infinite decimal expansion.

## `Program.explain`

An `Explanation` of one submission:

| Field | Holds |
| - | - |
| `book` | The submission's slice of the book, with the columns of the program's schema |
| `json_in` | The exact input the rater received; `None` when `prepare` failed for the submission |
| `trace` | The rater's trace, as `Rater.explain` returns it; `None` for an unrated submission |
| `json_out` | The rater's outcomes; `None` for an unrated submission |
| `row` | The submission's row of `Program.rate` |

## `Rater.explain` and `Explanation.trace`

One row per value, inputs first, then calculations in calculation order.

| Column | Holds |
| - | - |
| `kind` | `input` or `calculation` |
| `name` | The value's dotted path, such as `vehicles[0].premium` |
| `value` | The exact value; a rational value appears as a `Fraction` |

## Statuses

| Status | Meaning | Set by |
| - | - | - |
| `succeeded` | The rater rated the input and returned its outcomes | The rater |
| `invalid_inputs` | The input breaks the rater's declared input rules, such as a range | The rater |
| `refused` | The rater declines the risk, with the carrier's own code | The rater |
| `rating_failed` | The rating engine stopped with a fault | The rater |
| `mapping_failed` | `prepare` raised for this submission, or left it out; `reason_code` is `PREPARE_FAILED` or `NOT_PREPARED` | A program |
| `read_failed` | The program's `read` raised; `reason_code` is `READ_FAILED` | A program |
| `prediction_failed` | A loss model rejected the input it predicts for | A loss model |

A status describes rating. A carrier's underwriting appetite needs its own evidence, joined to
the results in pandas.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.