Context explanations
Context explanations enrich local explanations by adding comparison or scenario context.
A local explanation describes why a model produced a prediction for a specific query. A context explanation compares that query, prediction, or attribution pattern with another condition or another case. This can make the explanation easier to interpret, especially when the question is not only “why this prediction?” but “how would this prediction change if something were different?”
Examples include what-if analysis, control swaps, and nearest-neighbour comparisons.
Why context explanations matter
Context explanations are comparative and contrastive.
They help explain a prediction by showing how it relates to alternatives:
Control swap
A control swap explains how the value of a categorical feature affects a prediction.
It does this by comparing the original query with one or more versions of the same query where the categorical feature has been changed to another category.
For example, if a query involves a male person, the same query could be re-run with Gender set to Female to check whether the prediction changes. The prediction results can then be compared to see whether the outcome changed.
The module attributions and feature attributions can also be compared to identify where the differences appear and how the swap affected the prediction.
Because attributions are additive, they can be compared side by side or subtracted to calculate deltas. For example, to see the attribution effect of moving from Male to Female, subtract the original Male attributions from the Female attributions.
Control swap example
The example below shows a Gender control swap from Male to Female in a Hybrid Intelligence classification model.
In this case, the classification result did not change. The decrease in attributions shows bias favouring the Male class, but the final outcome was not affected.
Comparing the module and feature attributions shows that the largest attribution changes came from interactions between:




Nearest neighbour
Nearest-neighbour explanations use similarity to provide context for a prediction.
By examining similar, dissimilar, and related queries, they can provide insight into the model’s decision-making process.
Similarity is enabled by vector embeddings. In Hybrid Intelligence, vector embeddings organise information by placing objects on a virtual map: similar objects are close together, and different objects are farther apart. This makes it easier to find patterns and relationships.
Similarity
Similar neighbours are close to the query according to a chosen distance metric.
They can help explain a prediction by showing that the query is similar to other cases with the same or similar outcomes.
Dissimilarity
Dissimilar neighbours are far from the query according to a chosen distance metric.
Contrasting the query with dissimilar neighbours can highlight what makes the query unusual or why it was predicted differently from distant cases.
Relatedness
Related neighbours may not be the closest by distance, but they share characteristics or patterns that are relevant to the explanation.
They can provide context or additional insight that may not be obvious from nearest neighbours alone.

