Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

h2o.gbm interaction_constraints only builds single-depth trees #6873

Closed
exalate-issue-sync bot opened this issue May 11, 2023 · 2 comments
Closed

h2o.gbm interaction_constraints only builds single-depth trees #6873

exalate-issue-sync bot opened this issue May 11, 2023 · 2 comments
Assignees

Comments

@exalate-issue-sync
Copy link

I was testing using the example in the documentation: [https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/algo-params/interaction_constraints.html|https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/algo-params/interaction_constraints.html|smart-link] Although I switched from {{h2o.xgboost}} to {{h2o.gbm}}.

Every tree that gets built is single-depth. I tried expanding the possible predictors to include all available (non-response) variables and still they were all single-depth. Commenting out this argument results in trees with > 1 depth.

{noformat}prostate_gb <- h2o.gbm(y = response,
interaction_constraints = list(list("AGE", "DCAPS")),
seed = 1234,
training_frame = prostate)

prostate_gb@model$model_summary$max_depth
[1] 1

prostate_gb <- h2o.gbm(y = response,
interaction_constraints = list(list("DPROS", "GLEASON", "VOL", "PSA", "AGE", "DCAPS")),
seed = 1234,
training_frame = prostate)

prostate_gb@model$model_summary$max_depth
[1] 1

prostate_gb <- h2o.gbm(y = response,
seed = 1234,
training_frame = prostate)

prostate_gb@model$model_summary$max_depth
[1] 5 {noformat}

I found the unit test for this functionality and ran the example: [https://github.com/h2oai/h2o-3/blob/6758ed00b5200c782cd2bbebf0094374757dc472/h2o-r/tests/testdir_algos/gbm/runit_GBM_interaction_constraints.R|https://github.com/h2oai/h2o-3/blob/6758ed00b5200c782cd2bbebf0094374757dc472/h2o-r/tests/testdir_algos/gbm/runit_GBM_interaction_constraints.R|smart-link]

The test passes, but I believe it is because every tree was single-depth, so the interaction constraints were only inadvertently met.

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Details

Jira Issue: PUBDEV-8901
Assignee: Adam Valenta
Reporter: Paul Donnelly
State: Resolved
Fix Version: 3.38.0.3
Attachments: N/A
Development PRs: Available

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

Linked PRs from JIRA

#6416
https://github.com/h2oai/h2oai-serving/pull/1135

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

No branches or pull requests

2 participants