what_if
Compare a base scenario against a counterfactual with changed features to see the price impact, savings, or added cost, plus per-driver attribution and a reliability grade for the direction of the move.
Instructions
Compare a base scenario with a counterfactual where features change.
Returns a plain `summary` to quote directly (does the change add or save,
how many dollars, what percent, old vs. new price), plus both predictions,
the delta, and per-driver attribution of each change for your reasoning.
Answers "what if we switch from supplier A to B?" Set coverage to null to
skip intervals.
`summary.reliability` grades how far to trust the DIRECTION of the move —
'trust' | 'caution' | 'quote' — with a plain `summary.say_to_user` line to
quote. It fires when the changed spec is thinly sampled, or when the swing
is driven by knock-on effects rather than the change itself (a `quote` here
means the number is unstable — relay the caution, don't present the
direction as fact). It flags instability, not a wrong domain sign, so still
sign-check a 'trust' result against intuition.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| changes | Yes | ||
| coverage | No | ||
| features | Yes | ||
| model_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |