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

Infogram bug in algorithm_params #16179

Closed
valenad1 opened this issue Apr 26, 2024 · 2 comments
Closed

Infogram bug in algorithm_params #16179

valenad1 opened this issue Apr 26, 2024 · 2 comments
Assignees
Labels
Milestone

Comments

@valenad1
Copy link
Collaborator

import h2o
from h2o.estimators.infogram import H2OInfogram
h2o.init()
f = "https://erin-data.s3.amazonaws.com/admissible/data/taiwan_credit_card_uci.csv"
col_types = {'SEX': "enum", 'MARRIAGE': "enum", 'default_payment_next_month': "enum"}
df = h2o.import_file(path=f, col_types=col_types)
y = "default_payment_next_month"
x = df.columns
x.remove(y)
gbm_params = {'ntrees':3}
pcols = ["SEX", "MARRIAGE", "AGE"]
ig = H2OInfogram(protected_columns=pcols)
ig.train(y=y, x=x, training_frame=df, algorithm_params=gbm_params)
ig.algorithm_params

gives me:

TypeError                                 Traceback (most recent call last)
/var/folders/2z/9gdhqbns0djdj9crb242sgc00000gn/T/ipykernel_9099/4280293040.py in <cell line: 13>()
     11 pcols = ["SEX", "MARRIAGE", "AGE"]
     12 ig = H2OInfogram(protected_columns=pcols)
---> 13 ig.train(y=y, x=x, training_frame=df, algorithm_params=gbm_params)
     14 ig.algorithm_params

~/h2o-3/_valenad-notebooks/../h2o-py/build/main/h2o/estimators/infogram.py in train(self, x, y, training_frame, verbose, **kwargs)
   1202                                                                                    " and <= 1."
   1203 
-> 1204         parms = sup._make_parms(x,y,training_frame, extend_parms_fn = extend_parms, **kwargs)
   1205 
   1206         sup._train(parms, verbose=verbose)

TypeError: _make_parms() got an unexpected keyword argument 'algorithm_params'.
@wendycwong
Copy link
Contributor

@valenad1 : the algorithm_params is only allowed to be specified in ig = H2OInfogram(protected_columns=pcols, algorithm_params=gbm_params) and not when you call train.

@valenad1
Copy link
Collaborator Author

Thanks!

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

No branches or pull requests

2 participants