【问题标题】:Create similar decision tree model from R to Python using H2O使用 H2O 创建从 R 到 Python 的类似决策树模型
【发布时间】:2020-11-18 12:02:15
【问题描述】:

我目前正在尝试使用 H2O 构建决策树模型。

我看到几个问题,说我们可以通过扭曲里面的命令来使用随机森林。

如何将 R 代码更改为 H2O Python 代码?

tree = rpart(test ~ ., control = rpart.control(minbucket = nrow(data_test)/100, maxdepth = 2))

我的那个好像很奇怪,不工作!

rf_model = H2ORandomForestEstimator(balance_classes=True, ntrees=1, max_depth=2,
                                 mtries=10, seed=123, score_each_iteration=True)

rf_model.train(x=features, y='test', training_frame=h2o_df)

【问题讨论】:

  • 单树随机森林又称单树。

标签: python r decision-tree h2o


【解决方案1】:

您可以尝试使用以下 H2O 函数吗:h2o.randomForest() (link with an example)

关于您的参数,对于 min_bucket,我会尝试 min_rows = 1,即使 min_rows 应用于所有叶子,而不仅仅是终端叶子。

【讨论】:

    猜你喜欢
    • 2018-09-05
    • 2018-11-17
    • 2014-05-09
    • 2018-04-19
    • 2015-02-08
    • 2021-05-16
    • 2021-03-15
    • 2018-07-24
    • 2014-12-11
    相关资源
    最近更新 更多