h2o-3
h2o-3 copied to clipboard
GH-15991: Infogram pydocs updates
fixes #15991 Crafted new examples to showcase the different parameters.
And please merge it to re-3.46.0, the rel-3.44.0 is not used anymore.
@wendycwong
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'.
Ticket here.