简体   繁体   English

如何在 pROC 中为 multiclass.roc 图添加标题?

[英]How can I add a title to multiclass.roc plots in pROC?

I have a multinomial model constructed with nnet:multinom of 5 classes for 26 variables:我有一个用nnet:multinom构建的多项模型,包含 5 个类别的 26 个变量:

mirna_multinom_0 = multinom(formula_0, data= clase_training, maxit=10000 )

And then I create my ROCS with:然后我创建我的 ROCS:

multiclass.roc(clase_training$clase, mirna_multinom_0$fitted.values,plot=TRUE)

Which I plot.我绘制的。

pred_test_inter_multinom_5 = predict(interaction_multinom_model_5, newdata = clase_test, "probs")
multiclass.roc(clase_test$clase, pred_test_inter_multinom_5,plot=TRUE)

第一个对比 Ctrl 与 Group1 的图

To understand them I store it as an object e and call the contrast as names(e$roc) to see my contrasts.为了理解它们,我将它存储为对象e并将对比称为names(e$roc)以查看对比。

e = multiclass.roc(clase_training$clase, mirna_multinom_0$fitted.values)
names(e$rocs)

 [1] "Control/Idiop_grave"      "Control/Idiop_leve"       "Control/Isquem_grave"    
 [4] "Control/Isquem_leve"      "Idiop_grave/Idiop_leve"   "Idiop_grave/Isquem_grave"
 [7] "Idiop_grave/Isquem_leve"  "Idiop_leve/Isquem_grave"  "Idiop_leve/Isquem_leve"  
[10] "Isquem_grave/Isquem_leve"

Which gives me 2 plots for each of them, 1 in > direction and the other in < direction.这给了我每个人的 2 个图,1 个在 > 方向,另一个在 < 方向。

Now.现在。 Can I plot the titles of each contrast in the plots in someway?我可以以某种方式在图中绘制每个对比的标题吗?

And also, is there a way I can obtain the areas under the curve AUC for each one of the ROC contrast?而且,有没有一种方法可以获得每个 ROC 对比度的曲线 AUC 下的面积? I only obtain it in a message for the multinomial.我只在多项式的消息中获得它。 Which don't have a PROC plot.哪个没有 PROC 图。 Can I obtain a multinomial ROC, or its just a construct with no graphical representation?我可以获得多项式 ROC,还是只是一个没有图形表示的构造?

Can I plot the titles of each contrast in the plots in someway?我可以以某种方式在图中绘制每个对比的标题吗?

You will need to loop over the curves yourself, but it can be done easily like:您需要自己遍历曲线,但可以轻松完成,例如:

for (contrast in names(e$rocs)) {
    plot(e$rocs[[contrast]][[1]], col = "green", main = contrast)
    plot(e$rocs[[contrast]][[2]], col = "blue", add = TRUE)
}

is there a way I can obtain the areas under the curve AUC for each one of the ROC contrast?有没有一种方法可以获得每个 ROC 对比度的曲线 AUC 下面积?

You can do something similar with the auc function:你可以用auc函数做类似的auc

for (contrast in names(e$rocs)) {
    print(contrast)
    print(auc(e$rocs[[contrast]][[1]]))
    print(auc(e$rocs[[contrast]][[2]]))
}

Can I obtain a multinomial ROC, or its just a construct with no graphical representation?我可以获得多项式 ROC,还是只是一个没有图形表示的构造?

It is a sort of average of AUC described by Hand & Till in doi:10.1023/A:1010920819831 .它是 Hand & Till 在doi:10.1023/A:1010920819831 中描述的一种 AUC平均值 There is no corresponding curve to be represented.没有相应的曲线要表示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM