我正在尝试为不同的数据集和不同的算法绘制一堆ROC区域. 我有三个变量:"Scheme",它指定使用的算法;"Dataset",是要在其上测试算法的数据;以及"Area_under_ROC".
I am trying to plot a bunch of ROC areas for different datasets and different algorithms. I have three variables: "Scheme" which specifies the algorithm used, "Dataset" is the dataseet that the algorithm is being tested on, and "Area_under_ROC".
我正在R中使用晶格库,并使用以下命令:
I am using the lattice library in R, with the following command:
dotplot(方案〜Area_under_ROC |数据集,数据=模拟摘要,布局= c(4,6))
dotplot(Scheme ~ Area_under_ROC | Dataset, data = simulationSummary, layout = c(4,6))
这就是我得到的:
基于数据集的方案与Area_under_ROC的点图
我想知道的是
- 如何使y轴上的标签可读?现在,他们都被挤在一起了.
- 如何重新排列面板,使标记为"100"的数据集形成最后一列,而其他列保持不变?
非常感谢您提出任何意见或建议. 非常感谢!
I'd very much appreciate any comments or pointers. Many Thanks!
推荐答案一些想法:
重新设置因子Dataset,以便您感兴趣的数据集出现在layout放置它们的位置,或者(更好!)使用index.cond为24个面板指定特定排列.例如
Relevel your factor Dataset, so that the dataset you are interested appear where layout will put them, or (better!) use index.cond to specify a particular arrangement for your 24 panels. E.g., dfrm <- data.frame(algo=gl(11, 1, 11*24, labels=paste("algo", 1:11, sep="")), type=gl(24, 11, 11*24, labels=paste("type", 1:24, sep="")), roc=runif(11*24)) p <- dotplot(algo ~ roc | type, dfrm, layout=c(4,6), scale=list(y=list(cex=.4)))
将按从左下到右上的顺序排列面板(左下面板中的type1,右上面板中的type24),而
will arrange panels in sequential order, from bottom left to top right (type1 in bottom left panel, type24 in top right panel), while
update(p, index.cond=list(24:1))将以相反的顺序排列面板.只需指定具有预期面板位置的list.
will arrange panels in the reverse order. Just specify a list with expected panel locations.
这里是一个例子,说明了我对要点1的想法,并使用了两个因素而不是一个.让我们生成另一个人工数据集:
Here is an example of what I have in mind with Point 1 and the use of two factors instead of one. Let us generate another artificial dataset:
dfrm <- data.frame(algo=gl(11, 1, 11*24, labels=paste("algo", 1:11, sep="")), dataset=gl(6, 11, 11*24, labels=LETTERS[1:6]), ssize=gl(4, 11*6, 11*24, labels=c(10,25,50,100)), roc=runif(11*24)) xtabs(~ dataset + ssize, dfrm) # to check allocation of factor levels dotplot(algo ~ roc | dataset, data=dfrm, group=ssize, type="l", auto.key=list(space="top", column=4, cex=.8, title="Sample size", cex.title=1, lines=TRUE, points=FALSE))
更多推荐
在R的点阵封装中微调点图
发布评论