插入符号 - 错误 - 有问题 - 缺少所有 ROC 指标值: [英] caret - error - Something is wrong - all the ROC metric values are missing:

查看:32
本文介绍了插入符号 - 错误 - 有问题 - 缺少所有 ROC 指标值:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用插入符号包.在特定情况下,例如,但不限于以下示例,插入符号会产生以下错误:

i am using the caret package. At specific instances, as for example, but not exclusively per the example below, caret will produce the following error:

Something is wrong; all the ROC metric values are missing:
Error in train.default(x, y, weights = w, ...) : Stopping

奇怪的是,插入符号可能会用几乎相同的调用来做到这一点.例如.- 下面的第一个调用有效,第二个调用出错.我在包含时遇到了类似的问题,例如Verbose 参数,保持所有条件相同,或者当我在插入符号中运行特定包时(例如 SVM).

The strange thing is that caret might do this with nearly identical calls. E.g. - the first call per below works, the second call gives an error. i have had similar issue when i included e.g. the Verbose argument, keeping all things equal, or when i run specific packages in caret (e.g. SVMs).

我已经读到问题可能是类变量的定义,但我的主要变量是具有 2 个级别的标准因子,例如(因子 w/2 个级别NP"、P":1 1 1 1 1 1 1 1 1 1 ...).

I have read that the issue might be definition of the class variable, but my main variable is a standard factor with 2 levels, e.g. (Factor w/ 2 levels "NP","P": 1 1 1 1 1 1 1 1 1 1 ...).

有人有什么建议吗?

(抱歉没有包含可重现的示例)

(apologies for not including reproducible example)

Call 1
gbmFit1 <- train(class ~., data = dt_fulltrain,method = "gbm",metric="ROC",trControl = fitControl)

Call2
gbmFit1 <- train(class ~., data = dt_fulltrain,method = "gbm",metric="ROC",trControl = fitControl, strata = dt_fulltrain$class, sampsize = rep(nmin, 2))

推荐答案

我遇到了类似的问题,发现加载 pROC 库 (https://cran.r-project.org/web/packages/pROC/index.html) 训练前解决问题.

I've had a similar problem and found that loading the pROC library (https://cran.r-project.org/web/packages/pROC/index.html) before training solves the issue.

这篇关于插入符号 - 错误 - 有问题 - 缺少所有 ROC 指标值:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆