gpt4 book ai didi

r - 如何为 yardstick 包中的 roc_auc() 函数正确设置估计参数

转载 作者:行者123 更新时间:2023-12-04 10:37:05 25 4
gpt4 key购买 nike

我想计算模型的 AUC。

library(yardstick)
data(two_class_example)

此代码有效。
roc_auc(
two_class_example,
truth = truth,
Class1,
options = list(smooth = TRUE)
)

我喜欢指定参数,以便我的代码更易于阅读和调试。
roc_auc(
two_class_example,
truth = truth,
estimate=Class1,
options = list(smooth = TRUE)
)

这给出了以下错误

Error in metric_summarizer(metric_nm = "roc_auc", metric_fn = roc_auc_vec, : formal argument "estimate" matched by multiple actual arguments



请解释这个错误。我认为 Class1 列是估计类概率的向量。

最佳答案

根据该函数的帮助页面,Class1 变量位于 ...论证,而不是估计论证(事实上,似乎不存在这样的论证)。关于... ,它写道:

A set of unquoted column names or one or more dplyr selector functions to choose which variables contain the class probabilities. If truth is binary, only 1 column should be selected. Otherwise, there should be as many columns as factor levels of truth.



基本上,您无需担心指定。

关于r - 如何为 yardstick 包中的 roc_auc() 函数正确设置估计参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60123746/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com