gpt4 book ai didi

Error in `roc_auc()`: ! Can't rename variables in this context. Run `rlang::last_trace()` to see where the error occurred(`roc_auc()`出错:!无法在此上下文中重命名变量。运行`rlang::last_trace()`以查看错误发生的位置)

翻译 作者:bug小助手 更新时间:2023-10-26 22:19:22 32 4
gpt4 key购买 nike



When I make machine learning model of classification such as decision tree, randomforest like that,
I face the error

当我建立像决策树、随机森林这样的机器学习分类模型时,我会遇到错误


# ROC curve
final_pred %>%
roc_curve(truth = Personal_Loan,
estimate = .pred_Yes) %>%
autoplot()


Error in roc_curve():
! Can't rename variables in this context.
Run rlang::last_trace() to see where the error occurred.



# lift curve
final_pred %>%
lift_curve(truth = Personal_Loan,
estimate = .pred_Yes) %>%
autoplot()


Error in lift_curve():
! Can't rename variables in this context.
Run rlang::last_trace() to see where the error occurred.



# gain curve
final_pred %>%
gain_curve(truth = Personal_Loan,
estimate = .pred_Yes) %>%
autoplot()


Error in gain_curve():
! Can't rename variables in this context.
Run rlang::last_trace() to see where the error occurred.



update packages ( yardstick package)

更新程序包(标准程序包)


更多回答

Did you follow the suggestion from the error message and run rlang::last_trace()? Could you add the output of this comment to your question?

您是否按照错误消息中的建议运行了rlang::last_trace()?你能把这个评论的结果加到你的问题上吗?

The error probably comes from you naming the argument .pred_Yes. This argument does not exist in the yardstick::roc_curve function. It expects unquoted column names. So provided the column .pred_Yes exists in final_pred, try to run roc_curve(truth = Personal_Loan, .pred_Yes).

错误可能来自您将参数命名为.pred_Yes。Yardtick::Roc_Curve函数中不存在此参数。它需要无引号的列名。因此,如果FINAL_PRED中存在.pred_Yes列,请尝试运行ROC_CURE(TRUE=Personal_Loan,.pred_Yes)。

优秀答案推荐
更多回答

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