Is H2O target mean encoding available in Python?

Viewed 663
1 Answers

Like this:

from h2o.targetencoder import TargetEncoder

# Fit target encoding on training data
targetEncoder = TargetEncoder(x= ["addr_state", "purpose"], y = "bad_loan", fold_column = "cv_fold_te")
targetEncoder.fit(ext_train)

But this requires version at least 3.22

Here is a link to an example: https://github.com/h2oai/h2o-tutorials/blob/78c3766741e8cbbbd8db04d54b1e34f678b85310/best-practices/feature-engineering/feature_engineering.ipynb

And the link to code itself: https://github.com/h2oai/h2o-3/blob/master/h2o-py/h2o/targetencoder.py

Related