我注意到H2O已发布目标均值编码
http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-munging/target-encoding.html
仅带有R代码示例。有人有Python示例吗?
答案 0 :(得分:3)
赞:
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-3/blob/master/h2o-py/h2o/targetencoder.py