Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

BUG: shap.plots.bar with cohorts dict throws UnboundLocalError #3000

Closed
4 tasks done
thatlittleboy opened this issue Jun 17, 2023 · 0 comments · Fixed by #3001
Closed
4 tasks done

BUG: shap.plots.bar with cohorts dict throws UnboundLocalError #3000

thatlittleboy opened this issue Jun 17, 2023 · 0 comments · Fixed by #3001
Assignees
Labels
bug Indicates an unexpected problem or unintended behaviour
Milestone

Comments

@thatlittleboy
Copy link
Collaborator

thatlittleboy commented Jun 17, 2023

Bug report checklist

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of shap.
  • I have confirmed this bug exists on the master branch of shap.
  • I'd be interested in making a PR to fix this bug

Minimal Reproducible Example

import shap
import numpy as np

shap.plots.bar({
    "t1": shap.Explanation(
        values=np.random.randn(20, 5),
        base_values=0.5,
    ),
    "t2": shap.Explanation(
        values=np.random.randn(20, 5),
        base_values=0.5,
    ),
})

Issue Description

Run the above code snippet, an UnboundLocalError is thrown

image

Expected Behavior

No error is thrown

Installed Versions

The image above was with shap 0.41.0, but issue is reproducible with master (f77a5ae) as well.

@thatlittleboy thatlittleboy added the bug Indicates an unexpected problem or unintended behaviour label Jun 17, 2023
@thatlittleboy thatlittleboy added this to the 2023-06-fixes milestone Jun 17, 2023
@thatlittleboy thatlittleboy self-assigned this Jun 17, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Indicates an unexpected problem or unintended behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant