h2oai / h2o-3

H2O is an Open Source, Distributed, Fast & Scalable Machine Learning Platform: Deep Learning, Gradient Boosting (GBM) & XGBoost, Random Forest, Generalized Linear Modeling (GLM with Elastic Net), K-Means, PCA, Generalized Additive Models (GAM), RuleFit, Support Vector Machine (SVM), Stacked Ensembles, Automatic Machine Learning (AutoML), etc.

Home Page:http://h2o.ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infogram bug in algorithm_params

valenad1 opened this issue · comments

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'.

@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.

Thanks!