使用H2O实施决策树 [英] Implementing a decision tree using h2o

查看:107
本文介绍了使用H2O实施决策树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用h2o训练决策树模型.我知道在h2o中不存在用于决策树的特定库.但是,h2o具有随机森林 H2ORandomForestEstimator 的实现.我们能否通过调整随机森林的某些输入参数在h2o中实现决策树?因为我们可以在scikit模块(用于机器学习的流行python库)中做到这一点

I am trying to train a decision tree model using h2o. I am aware that no specific library for decision trees exist in h2o. But, h2o has an implemtation of random forest H2ORandomForestEstimator . Can we implement a decision tree in h2o by tuning certain input arguments of random forests ? Because we can do that in scikit module (a popular python library for machine learning)

引用链接: 为什么是拥有一棵树的随机森林比决策树分类器好得多?

在scikit中,代码看起来像这样

In scikit the code looks something like this

RandomForestClassifier(n_estimators=1, max_features=None, bootstrap=False)

我们在h2o中是否具有与该代码相当的代码?

Do we have a equivalant of this code in h2o ?

推荐答案

您可以使用H2O的随机林(H2ORandomForestEstimator),将ntrees=1设置为仅构建一棵树,将mtries设置为要素数量(即列)在数据集中和sample_rate =1中.将mtries设置为数据集中的要素数量意味着算法将从决策树中每个级别的所有要素中随机采样.

you can use H2O's random forest (H2ORandomForestEstimator), set ntrees=1 so that it only builds one tree, set mtries to the number of features (i.e. columns) you have in your dataset and sample_rate =1. Setting mtries to the number of features in your dataset means the algo will randomly sample from all of your features at each level in the decision tree.

这里是有关mtries的更多信息: http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/algo-params/mtries.html

here is more information about mtries:http://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/algo-params/mtries.html

这篇关于使用H2O实施决策树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆