问题标签 [auc]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
422 浏览

r - 如何向量化曲线下面积的计算

我的目标:我正在计算每 5 行 xts 的其中一列的曲线下面积。

我的目标:我想知道 R 中是否有一个函数可以更快地完成它(向量化它),而不是从 myxts5 的列中创建一个向量,然后循环计算。

谢谢你的帮助。

我已经包含了我的代码、输出和数据集:

这是我的输出:

这是数据集:

0 投票
1 回答
345 浏览

r - r - trapz 似乎没有正确计算 AUC

我已经绘制了 FPR 与 TPR 的关系图,以制作几条 ROC 曲线,如链接所示。

但是,在我看来,trapz() 没有计算底部 2 条曲线的正确 AUC。AUC 似乎大于先前图的 AUC,但计算出的 AUC 较低。

谁能向我解释这是为什么?

先感谢您。

0 投票
1 回答
7637 浏览

r - 没有足够的不同预测来计算 roc 下的面积

我想使用 来计算 AUC auc(roc(predictions, labels)),其中labels1(x15) 和0(x500) 的数值向量,并且是具有从[二项式]predictions派生的概率的数值向量。glm它应该很简单,但auc(roc(predictions, labels))会给出错误消息“没有足够的不同预测来计算 ROC 曲线下的面积”。我一定在做一些傻事,但我不知道是什么。你能?

代码是

0 投票
2 回答
831 浏览

matlab - Matlab 中的交叉验证和性能曲线

我正在尝试在交叉验证代码中使用 perfcurv。然而,在某些时候,测试数据集的所有成员都属于同一类 (0)。我的问题是二进制分类问题。因此会出现以下错误:

使用 perfcurve 时出错(第 368 行) 在真实类标签数组中发现的类少于两个。

loadsurfperframe_GIE_leave_one_out 错误(第 669 行)[x,y,t,AUC(i),OPTROCPT,SUBY,SUBYNAMES] = perfcurve(test_classes,ytest,1);

我应该怎么做才能解决这个问题?

0 投票
0 回答
391 浏览

r - 输入以在 R 中生成 AUC / ROC

我有一些医院数据,我想看看是否有任何先前的条件可以预测特定的结果。为了能够确定哪种条件最能预测结果,我将计算每种条件组合的 AUC。

我找到了几页解释如何做到这一点:

https://gist.github.com/cjbayesian/6921118

http://www.r-bloggers.com/calculating-auc-the-hard-way/

计算R中的AUC?

但是,我不确定我的输入应该是什么样的。在最后一个链接中,我可以看到这样的输入:

-但是这些数字是多少?我猜它与 T/F 正面/负面有关?

谢谢

0 投票
1 回答
261 浏览

r - 曲线下面积

我想绘制曲线和实线之间的区域并对其进行着色,但无法做到。我尝试使用 pracma 包中的 trapz 函数。任何建议,将不胜感激?

0 投票
0 回答
326 浏览

r - Find AUC with tree package - binary response

Attempting to get ROC Curve and AUC for CART decision tree which was made using "tree" package.

Here is the Structure of my tree

'data.frame': 13 obs. of 6 variables:

$ var : Factor w/ 15 levels "","Age",..: 15 10 1 11 11 5 1 1 15 1 ...

$ n : num 383 158 29 129 110 38 20 18 72 7 ...

$ dev : num 461.1 218.6 29.6 174 141.8 ...

$ yval : Factor w/ 2 levels "Negative","Positive": 2 2 1 2 2 1 2 1 2 1 ...

$ splits: chr [1:13, 1:2] "<19.5" "<81.5" "" "<65" ...

..- attr(*, "dimnames")=List of 2

.. ..$ : NULL

.. ..$ : chr "cutleft" "cutright"

$ yprob : num [1:13, 1:2] 0.29 0.475 0.793 0.403 0.345 ...

..- attr(*, "dimnames")=List of 2

.. ..$ : NULL

.. ..$ : chr "Negative" "Positive"

Referencing the above structure, I have written (many variations of) the following code:

Error in prediction(pruned.tree7$frame$yprob, dimnames(pruned.tree7$frame$yprob)) : Number of predictions in each run must be equal to the number of labels for each run.

Error in prediction(pruned.tree7$frame$yprob, dimnames) : Format of labels is invalid.

Error in prediction(pruned.tree7$frame$yprob, "dimnames") : Number of cross-validation runs must be equal for predictions and labels.

Error in is.data.frame(labels) : object 'yprob' not found

Error in prediction(pruned.tree7$frame$yprob, names(pruned.tree7$frame$yprob)) : Format of labels is invalid.

Error in prediction(pruned.tree7$frame$yprob, dimnames(pruned.tree7$frame$yprob)) : Number of predictions in each run must be equal to the number of labels for each run.

I have searched and found this link: ROCR Package Documentation It mentions the topic of cross-validation. However, it does not make sense to me.

Thank you in advance!!

0 投票
0 回答
241 浏览

matlab - 计算矩阵分解输出的 AUC 度量

初始矩阵包含链接预测系统中1的已知链接(0未知和错过的条目)。矩阵分解的输出是要计算的错过条目的预测值AUC

  1. 隐藏20%已知链接(矩阵中带有to20%的条目集)10
  2. 对 Factorization 的输出进行排序并丢弃用于 train ( 80%of 1)的索引
  3. 设置N为隐藏值的数量
  4. 获取N最高预测值并检查它们是否是隐藏值(类标签设置为1)或不是(类标签设置为0
  5. AUC使用N最高预测进行计算

我知道perfcurve在 matlab 计算中AUC,但我需要确定上述过程以提供标记数据perfcurve

任何评论都非常感谢。

0 投票
1 回答
12903 浏览

r - 为 R 中的逻辑回归模型绘制多条 ROC 曲线

我有一个逻辑回归模型(使用 R)作为

我正在使用pROC包来绘制 ROC 曲线并计算 6 个模型 fit1 到 fit6 的 AUC。

我已经采用这种方式来绘制一个 ROC。

但是有没有一种方法可以将所有 6 条曲线的 ROC 组合在一个图中,并显示所有曲线的 AUC,如果可能的话还显示置信区间。

0 投票
2 回答
4949 浏览

python - 如何在 python 中计算一类 SVM 的 AUC?

我很难在 python 中绘制 OneClassSVM 的 AUC 图(我正在使用 sklearn 生成混淆矩阵[[tp, fp],[fn,tn]],如fn=tn=0.

我想处理错误 [1] 并AUCOneClassSVM.