【发布时间】:2019-01-10 10:56:36
【问题描述】:
我正在尝试实现 FBeta_Score() 的 MLmetrics R package:
FBeta_Score <- function(y_true, y_pred, positive = NULL, beta = 1) {
Confusion_DF <- ConfusionDF(y_pred, y_true)
if (is.null(positive) == TRUE)
positive <- as.character(Confusion_DF[1,1])
Precision <- Precision(y_true, y_pred, positive)
Recall <- Recall(y_true, y_pred, positive)
Fbeta_Score <- (1 + beta^2) * (Precision * Recall) / (beta^2 * Precision +
Recall)
return(Fbeta_Score)
}
在H2O distributed random forest model 中,我想在训练阶段使用custom_metric_func 选项对其进行优化。
h2o.randomForest() 函数的帮助文档说:
引用自定义求值函数,格式: '语言:keyName=funcName'
但我不明白如何直接从 R 中使用它以及我应该在 stopping_metric 选项中指定什么。
任何帮助将不胜感激!
【问题讨论】:
标签: r customization packages random-forest h2o