Skip to content

Fix interaction plot sampling indices - #836

Open
guillaume-vignal wants to merge 3 commits into
MAIF:developfrom
guillaume-vignal:fix/interaction-plot-sampling-list
Open

guillaume-vignal wants to merge 3 commits into
MAIF:developfrom
guillaume-vignal:fix/interaction-plot-sampling-list

Conversation

@guillaume-vignal

Copy link
Copy Markdown
Collaborator

Fixes #835

  • Convert smart-sampling results from NumPy arrays to lists.
  • Update return type annotations and documentation.
  • Add tests for sampling return types.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@guillaume-vignal guillaume-vignal self-assigned this Nov 13, 2026
@guillaume-vignal guillaume-vignal added the bug Something isn't working label Nov 13, 2026
@codecov

codecov Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.47%. Comparing base (cda4d07) to head (c821b47).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #836      +/-   ##
===========================================
+ Coverage    86.37%   86.47%   +0.09%     
===========================================
  Files          115      115              
  Lines        11958    11966       +8     
  Branches      2176     2180       +4     
===========================================
+ Hits         10329    10347      +18     
+ Misses         996      988       -8     
+ Partials       633      631       -2     
Files with missing lines Coverage Δ
shapash/explainer/explainer.py 82.60% <100.00%> (+0.08%) ⬆️
shapash/explainer/smart_plotter.py 78.02% <100.00%> (+0.13%) ⬆️
shapash/utils/sampling.py 95.60% <100.00%> (+10.98%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@milton-minervino milton-minervino left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand well the if selection: in get_interaction_values check is the real problem here. Maybe it is worth to check the behaviour with an empty list: with the current code you would get all rows, is that wanted?
If you switch to condition if selection is not None: that would give 0 rows.

This branch has not been deployed

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

interactions_plot raises ValueError when smart sampling returns a NumPy array

2 participants