Ask for an explanation
Add"explain": true to any prediction request: /v1/predict, /v1/fill, /v1/forecast, a database prediction or a task described in words. By default the ten largest effects of each prediction are returned. Change this with explain_top.
What an explanation holds
ofsays which number is explained. For a regression or a forecast, it is the mean. For a classification, it is the probability of the class inexplain_class. Withoutexplain_class, it is the probability of the predicted label.baselineis the average prediction over the context. It is where a row would land if it told the model nothing.- Each contribution gives an input, the row’s value for it, and its effect. A positive effect pushes the prediction up, and a negative effect pushes it down.
restis the total effect of the inputs not listed.
rest add up to the prediction.
What counts as an input
An input is something you would recognise in your own data.Importance over many rows
The report of a request with explanations hasimportance. For each input, it gives the average size of its effect over the rows predicted. Use it to see which inputs matter most across a portfolio, a region or a period.
Reason codes
For a credit decision, ask for the probability of the bad outcome withexplain_class, and take the inputs with the largest positive effects as the reasons. Map each input to the wording your policy uses, such as “number of recent credit enquiries”.
Reading explanations with care
- An explanation describes how the model used the inputs for this prediction. It does not say that an input causes the outcome.
- When two inputs carry the same information, such as a total and its parts, the effect can be shared between them. Look at such inputs together.
- Explanations take longer to compute than the predictions alone. Ask for them where you need them, for example on the rows you decline or review.