如何解决来自 plotROC 的 direct_label() 不适用于方面
我正在使用 >>> list(vars(super))
['__repr__','__getattribute__','__get__','__init__','__new__','__thisclass__','__self__','__self_class__','__doc__']
>>> vars(super)['__thisclass__']
<member '__thisclass__' of 'super' objects>
>>> s = super(int,123)
>>> s.__thisclass__ = float
Traceback (most recent call last):
File "<stdin>",line 1,in <module>
AttributeError: readonly attribute
>>> del s.__thisclass__
Traceback (most recent call last):
File "<stdin>",in <module>
AttributeError: readonly attribute
package 创建具有多个度量的 ROC 曲线我想通过提取 AUC 值(而不是复制粘贴),但考虑到我也在尝试方面遇到错误。 plotROC
function 适用于单个情节,但不适用于分面。
这会产生我想要的分面图。
direct_labels()
但是当我尝试像这样打印 AUC 值时:
plot <- ggplot(longdf,aes(d = D,m = M,color = name )) + # multiple curves on each plot
geom_roc() + # plots the ROC curve
facet_wrap (~ anchor) # Separate plots for each anchor
我收到错误
# Save AUC values to add as labels
auctxt <- calc_auc(plot)
auctxt$label <- sprintf("AUC = %.2f",auctxt$AUC) # 2 digitsr
auctxt
# Output: Panel corresponds with the right `anchor` variable (but the 2 anchors have proper names,and group with `name`
PANEL group AUC label
1 1 1 0.5329524 AUC = 0.533
2 1 2 0.4848525 AUC = 0.485
3 1 3 0.5855700 AUC = 0.586
4 2 1 0.5212598 AUC = 0.521
5 2 2 0.4770866 AUC = 0.477
6 2 3 0.4323622 AUC = 0.432
# Create plot,showing AUC labels
direct_label(plot,labels = auctxt$label,size = 3.5)
Error: Aesthetics must be either length 1 or the same as the data (6): label and colour
输出显示 2 个面板对应 auctxt
变量中的 2 个级别,以及 anchor
中级别数的组数,因此必须是一种指定喂食/排列我的标签以匹配颜色的方法...
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。