r - R h2o:如何为 GBM 实现自定义停止度量
问题描述
我发现现在可以使用stopping_metric = custom
in h2o v3.22.1.1
(在 中不可用v3.10.0.9
),但是我没有找到如何在 R 中实现它的任何地方。
这是问题的玩具版本。
library(h2o)
h2o.init()
x <- data.frame(
x = rnorm(1000),
z = rnorm(1000),
y = factor(sample(0:1, 1000, replace = T))
)
train <- as.h2o(x)
h2o.gbm(x = c('x','z'), y = 'y', training_frame = train, stopping_metric = 'custom', stopping_rounds = 3)
我得到的错误如下:
Error in .h2o.doSafeREST(h2oRestApiVersion = h2oRestApiVersion, urlSuffix = page, :
ERROR MESSAGE:
Illegal argument(s) for GBM model: GBM_model_R_1548836369139_123. Details: ERRR on field: _stopping_metric: Custom metric function needs to be defined in order to use it for early stopping.
如何custom
stopping_metric
为 GBM 定义?
解决方案
R API 目前不提供此功能。如果这是您感兴趣的功能,我会在此处为您的用例创建一个 JIRA 。您可以使用Darren指出的另一个 SO 问题,以获取有关如何通过 Python API 使用此功能的信息。
推荐阅读
- ios - 将应用程序上传到 iTunes Connect 时出现问题
- android - 获取是否在 android 6 中启用了后台数据限制的代码
- python - 如何为方法响应制作类型提示,其中响应取决于python中的方法参数?
- cmake - 通过 Cmake 外部项目传递依赖
- excel - VBA - 获取工作表中值的行号,然后将不同的值插入同一行的不同列
- .net-core - NuGet 的 npm 版本模拟
- java - Java swing 重用监听器
- javascript - Puppeteer Web Scraper 返回空数据
- javascript - 如何在 Angular 模板中设置多个道具?
- python - 调试 Exact Cover Pentominoes,维基百科示例不完整?或者......我误解了一些东西(包括代码)