Skip to content

Extend Local Plot to Support Subset of Selected Instances #659

@guillaume-vignal

Description

@guillaume-vignal

Description

Currently, the Shapash Local Plot displays the Shapley contributions for a single selected individual. This is extremely useful for local interpretability, but it becomes limiting when users interactively select a region of points (subset of individuals) from projection or other scatter plots.

The application already allows users to:

  • Select a region (lasso or rectangular selection) of points in the Contributions Projection Plot.
  • Select multiple points in other graphical components.

However, the Local Plot still only reflects the explanation of one individual at a time.

Feature Proposal

Extend the Local Plot functionality to support the visualization of Shapley contributions for a subset of selected individuals, instead of a single instance only.

This new feature would enable users to dynamically switch between:

  • Single instance explanation (current behavior)
  • Subset explanation (new behavior)

Expected Behavior

When a region or multiple points are selected:

  1. The Local Plot should update to display aggregated Shapley contributions for the selected subset.

  2. Possible aggregation strategies could include:

    • Mean absolute Shapley values
    • Median contributions
    • Distribution (boxplot )
  3. A toggle or automatic mode could be used:

    • Single selection leads to the current local plot
    • Multiple selection leads to an aggregated local plot

Use Cases

  • Analyze why a specific cluster behaves abnormally.
  • Understand the dominant features driving predictions for a group of similar instances.
  • Compare different regions of the projection space.

Implementation Notes

  • Detect multi-point selections from interactive plots.
  • When multiple points are selected, compute aggregated Shapley values over the selected indices.
  • Adapt the Local Plot component to display group-level explanations.
  • Provide clear visual distinction between single and group explanations.

UI / UX Suggestions

  • Display a label such as:
    "Explanation for 24 selected instances"
  • Add an uncertainty/standard deviation band to the plot for each feature

Expected Benefits

  • Enhanced interpretability at cluster level.
  • Better understanding of model behavior on specific regions of the data.
  • Strengthened analytical workflow between global and local explanations.

This enhancement would significantly improve exploratory analysis by enabling users to interpret not only individual predictions but also collective behaviors across selected groups of instances.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions