10000 Add user friendly string options for interaction constraints in HistGradientBoosting* · Issue #24845 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
Add user friendly string options for interaction constraints in HistGradientBoosting* #24845
Closed
@lorentzenchr

Description

@lorentzenchr

Describe the workflow you want to enable

model_no_interactions = HistGradientBoostingRegressor(
    interaction_cst="no_interactions"
)

model_pairwise_interactions = HistGradientBoostingRegressor(
    interaction_cst="pairwise"
)

instead of

model_no_interactions = HistGradientBoostingRegressor(
    interaction_cst=[[i] for i in range(X_train.shape[1])]
)

model_pairwise_interactions = HistGradientBoostingRegressor(
    interaction_cst=list(itertools.combinations(range(n_features), 2))
)

Describe your proposed solution

  • "no_interactions" is straight forward.
  • "pairwise" expands to a list that is quadratic in number of features. It might be more memory efficient to use generators internally.

Describe alternatives you've considered, if relevant

No response

Additional context

This was proposed as follow-up in #21020 (comment).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0