Skip to content

Simplify local explanation filtering controls and improve threshold slider usability #727

Description

@guillaume-vignal

Context

In the local explanation view, users currently have two filtering mechanisms:

  • Threshold slider: display only features whose absolute contribution exceeds a given value.
  • Number of Features slider: display only the top N most influential features.
Image

Discussions with users revealed that these two controls are often used for the same purpose: reducing visual noise and focusing on the most important contributors. This creates some redundancy in the interface and can make the filtering experience less intuitive.

Proposed changes

1. Simplify the default experience

By default, only the Threshold slider will be displayed.

A new setting will allow users to choose between:

  • Threshold only
  • Number of Features only
  • Both controls

This keeps the interface simple for most users while preserving flexibility for advanced workflows.

Image

2. Improve threshold slider scaling

Currently, the threshold slider uses the maximum contribution value as its upper bound. In practice, a few extreme SHAP values can stretch the range, making it difficult to select meaningful thresholds precisely.

Instead, the default upper bound will be computed using a percentile-based approach. For example:

upper_bound = np.percentile(np.abs(shap_values), 95)

This means that 95% of contribution values will fall below the upper bound of the slider, providing a much more usable scale while reducing the influence of outliers.

3. Make the percentile configurable

The percentile used to compute the threshold slider upper bound will also be exposed in the settings.

Examples:

  • 90th percentile
  • 95th percentile (default)
  • 99th percentile
  • 100th percentile (equivalent to the current behavior)

This gives users full control over how aggressive the outlier filtering should be.

Default behavior

  • Display Threshold slider only.

  • Use the 95th percentile as the slider upper bound.

  • Allow users to switch between:

    • Threshold only
    • Number of Features only
    • Both controls
  • Allow users to configure the percentile used for the threshold scale.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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