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

Populate base_models attribute in Stacked Ensemble in Python and R #8847

Closed
exalate-issue-sync bot opened this issue May 12, 2023 · 1 comment
Closed

Comments

@exalate-issue-sync
Copy link

Example showing that it's blank:

{code:python}import h2o
from h2o.automl import H2OAutoML
h2o.init()

Import a sample binary outcome train/test set into H2O

train = h2o.import_file("https://s3.amazonaws.com/erin-data/higgs/higgs_train_10k.csv")
test = h2o.import_file("https://s3.amazonaws.com/erin-data/higgs/higgs_test_5k.csv")

Identify predictors and response

x = train.columns
y = "response"
x.remove(y)

For binary classification, response should be a factor

train[y] = train[y].asfactor()
test[y] = test[y].asfactor()
aml = H2OAutoML(max_models=5, seed=1)
aml.train(x=x, y=y, training_frame=train)

In [12]: aml.leader.algo
Out[12]: 'stackedensemble'
In [11]: aml.leader.base_models #this is blank...{code}

The leader model is a stacked ensemble.

There is a dictionary of info about the base models here, aml.leader.get_params()\['base_models'], but i think it would be more useful to return a list of the actual model IDs instead of the dictionary with metadata that appears there. e.g. {{base_models = ["GBM_model_R_1582581833131_73", "DRF_model_R_1582581833131_201"]}}

In R, we don’t currently have an attribute for {{base_models}} so we will need to add one (similar to how we store extra info in the {{metalearner}} attribute).

@h2o-ops
Copy link
Collaborator

h2o-ops commented May 14, 2023

JIRA Issue Migration Info

Jira Issue: PUBDEV-6787
Assignee: Tomas Fryda
Reporter: Erin LeDell
State: Resolved
Fix Version: 3.28.1.2
Attachments: N/A
Development PRs: Available

Linked PRs from JIRA

#4388

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