Skip to content

GH-16758: Fix R shap summary plot#16789

Open
tomasfryda wants to merge 1 commit intorel-3.46.0from
tomf_GH-16758_fix_shap_summary_plot
Open

GH-16758: Fix R shap summary plot#16789
tomasfryda wants to merge 1 commit intorel-3.46.0from
tomf_GH-16758_fix_shap_summary_plot

Conversation

@tomasfryda
Copy link
Contributor

Copilot AI review requested due to automatic review settings March 26, 2026 11:39
@tomasfryda tomasfryda self-assigned this Mar 26, 2026
@tomasfryda tomasfryda added this to the 3.46.0.11 milestone Mar 26, 2026
@sonarqubecloud
Copy link

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes h2o.shap_summary_plot() failing when the input data includes a predictor column named id (GH-16758), by avoiding stats::reshape()’s default/generated id column name collision.

Changes:

  • Add an internal helper to generate a guaranteed-non-colliding column name.
  • Update h2o.shap_summary_plot() to pass a safe idvar into stats::reshape() calls.
  • Add regression tests covering both numeric and categorical id predictors.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
h2o-r/h2o-package/R/explain.R Ensures stats::reshape() uses a non-colliding idvar when reshaping contributions and feature values.
h2o-r/tests/testdir_misc/explain/runit_shap_summary_plot_id_column.R Adds regression coverage to ensure SHAP summary plotting succeeds when a predictor is named id (numeric and categorical).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants