H2O 目标均值编码在 Python 中可用吗?

2024-01-04

我注意到 H2O 已经发布了目标均值编码

http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-munging/target-encoding.html http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-munging/target-encoding.html

它仅附带一个 R 代码示例。有人有Python 的例子吗?


像这样:

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)

但这需要版本至少为3.22

这是示例的链接:https://github.com/h2oai/h2o-tutorials/blob/78c3766741e8cbbbd8db04d54b1e34f678b85310/best-practices/feature-engineering/feature_engineering.ipynb https://github.com/h2oai/h2o-tutorials/blob/78c3766741e8cbbbd8db04d54b1e34f678b85310/best-practices/feature-engineering/feature_engineering.ipynb

以及代码本身的链接:https://github.com/h2oai/h2o-3/blob/master/h2o-py/h2o/targetencoder.py https://github.com/h2oai/h2o-3/blob/master/h2o-py/h2o/targetencoder.py

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

H2O 目标均值编码在 Python 中可用吗? 的相关文章

随机推荐