本文介绍了H2O目标均值编码在Python中可用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I noticed H2O has released the target mean encoding

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

它仅带有R代码示例.有人有Python示例吗?

It only comes with an R code example. Does anyone have a Python example?

推荐答案

像这样:

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

But this requires version at least 3.22

这是示例的链接: 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

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

这篇关于H2O目标均值编码在Python中可用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 00:56