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

Add ability to specify algo parameters (e.g. monotonicity constraints) in H2O AutoML #8896

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

Comments

@exalate-issue-sync
Copy link

h1. Initial demand

Expose monotonicity constraints to AutoML.

We can follow the existing convention for GBM and XGBoost, which is to use an argument called monotone_constraints. [https://github.com/h2oai/h2o-3/blob/master/h2o-docs/src/product/data-science/algo-params/monotone_constraints.rst|https://github.com/h2oai/h2o-3/blob/master/h2o-docs/src/product/data-science/algo-params/monotone_constraints.rst|smart-link]

[http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/gbm.html?highlight=monotone|http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/gbm.html?highlight=monotone]
[http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/xgboost.html?highlight=monotone|http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/xgboost.html?highlight=monotone]

h1. Extended Proposal

To avoid multiplication of algo-specific parameters, and to improve customizability of AutoML internals (at users own risks), I suggest to expose all algo-specific constraints through a single {{algo_parameters}} param.

For example, in Python:

{code:python}algo_parameters=dict(
monotone_constraints=dict(AGE=1)
){code}

will apply the given {{monotone_constraints}} to all models and grids that support this parameter.

Whereas:

{code:python}algo_parameters=dict(
XGBoost__monotone_constraints=dict(AGE=1)
){code}

will apply it only to all {{XGBoost}} models (more precisely, to all models created by the {{XGBoostStepsProvider}}, itself registered with name=XGBoost).

This can be used in combination to constraint multiple algorithms:

{code}algo_parameters=dict(
monotone_constraints=dict(AGE=1),
ntrees=100,
XGBoost__ntrees=200,
GBM__grids__ntrees=[50, 100, 200],
){code}

will apply given parameters as follow:

  • monotone_constraints to all models and grids supporting it (GBM + XGBoost)
  • ntrees=100 to all models and grids supporting it (DRF, GBM, XGBoost), overriding the value defined on backend.
  • ntrees=200 to all XGBoost models and grids, overriding the value defined on backend and ignoring the previous ntrees=100.
  • ntrees=[50, 100, 200] as an hyperparameter for all GBM grids, ignoring the default ntrees param or hyperparam for those grids. The array syntax is interpreted as an hyperparameter only if set explicitely for grids.
@exalate-issue-sync
Copy link
Author

Sebastien Poirier commented: [~accountid:557058:afd6e9a4-1891-4845-98ea-b5d34a2bc42c] didn’t we have a ticket about customizing algo parameters?

Just wondering if we could not provide a dictionary for those params instead of exposing them one by one.
Something like algo_parameters and for each algo in AutoML, if it supports a key, we set it… could it be risky?
for example in Py:

{code:python}aml = H2OAutoML(..., algo_parameters=dict(monotone_constraint={})){code}

A safer alternative approach would be to offer the possibility to expose each algo individually:

{code:python}aml = H2OAutoML(..., algo_parameters=dict(
XGBoost=dict(
monotone_constraints={},
ntrees=50,
),
GBM=dict(
monotone_constraints={},
)
)){code}

or we could combine both…
This would directly bring a lot of flexibility for users who want to tune AutoML instead of exposing params one after another.
Any thoughts?

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Migration Info

Jira Issue: PUBDEV-6737
Assignee: Sebastien Poirier
Reporter: Nidhi Mehta
State: Resolved
Fix Version: 3.28.0.1
Attachments: N/A
Development PRs: Available

Linked PRs from JIRA

#4020
#4071
#4005

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

1 participant