登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

云之南

风声,雨声,读书声,声声入耳;家事,国事,天下事,事事关心

 
 
 

日志

 
 
关于我

专业背景:计算机科学 研究方向与兴趣: JavaEE-Web软件开发, 生物信息学, 数据挖掘与机器学习, 智能信息系统 目前工作: 基因组, 转录组, NGS高通量数据分析, 生物数据挖掘, 植物系统发育和比较进化基因组学

R-ROC曲线  

2011-06-10 23:17:06|  分类: R&Bioconductor |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |
ROC曲线的全称为“接受者操作特性曲线”(receiver operating characteristic)
http://chen.yi.bo.blog.163.com/blog/static/150621109201042641952619/
http://rocr.bioinf.mpi-sb.mpg.de/
http://www.molecularsciences.org/statistics_with_R/creating_ROC_curves_using_R


INTRODUCTION
ROC is a technique with which one can visualize, organize and select classifiers on the bases of its qualities and performances. The ROC is represented graphically by plotting relationship between true positive and false positive rate where as true positive rate (sensitivity) is placed on x-axis and false positive rate (1-specificity) on y-axis. The ROC curve is analyzed keeping two important points in mind that is area under curve and shape of the curve. If the ROC curve rises toward upper left corner then the larger would be a value of area under curve and test performance is good(true positive rate is high). Area under curve would have values between 0 and 1. If the curve decline from upper left corner to lower right corner it means the test performance is bad(flase positive rate is high).[1-3]

MATERIAL AND METHOD
The code for the ROC curve module was taken from the website which was written in R language. RGui is used as an interface for running the code. First of all ROCR package and Verification package was installed on R interface which are needed to run the code.
In order to install the packages internet connection was enabled then in RGui interface install. packages(“ROCR”) command was used and it was installed automatically. The same procedure was followed for the verification package.

ROC CURVE MODULE IN R

# it allows two different plots in the same frame
par(mfrow = c(1,2))
# plot a ROC curve for a single prediction run
# and color the curve according to cutoff.
library(ROCR)
data(ROCR.simple)
pred <- prediction(ROCR.simple$predictions, ROCR.simple$labels)
perf <- performance(pred,"tpr", "fpr")
plot(perf,colorize = TRUE)
# plot a ROC curve for a single prediction run
# with CI by bootstrapping and fitted curve
library(verification)
roc.plot(ROCR.simple$labels,ROCR.simple$predictions, xlab = "False positive rate",
ylab = "True positive rate", main = NULL, CI = T, n.boot = 100, plot = "both", binormal = TRUE)
(auc <- as.numeric(performance(pred, measure = "auc", x.measure = "cutoff")@y.values))
[4]

RESULTS

R-ROC曲线 - 云之南 - 云之南

DISCUSSION

The arguments and functions used in the code are as following:

Par: A function use to access and modify the graphic parameters
mfrow: A graphic parameter use in par function which means multiple figures in row
library(ROCR): Command for loading ROCR package in code
ROCR.simple: Data set for prediction sets and class labels
Prediction: A function that converts the input data into standardized format
pred <- prediction: Prediction function is assigned to pred object.
ROCR.simple$predictions: Vector numerical prediction
ROCR.simple$labels: Vectors for true class labels
Performance: A function to make predictor elevation
"tpr", "fpr": Performance measures
Colorize=TRUE: The curve is colorized according to cutoffs
Plot: A function for plotting R objects. To show different plots parameters are assigned like “both”, ”binorm” and ”emp”(default).
roc.plot: A function that plots a ROC for a given model
xlab, ylab: Label the x and y axes as false positive and true positive rate
main: Title for plot
CI: Confidence Intervals
n.boot: Number of bootstarp sample
binormal: If its set to true then binormal roc curve is calculated
auc: Area under curve
as.numeric: Generic function that attempts to change arguments to “double”
measure=”auc”: auc is a performance measure use for an evaluation
x.measure = "cutoff": It’s different form of performance measure where x.measure is taken as a unit on x axis and measure is taken
as a unit on y axis and two dimensional curve is obtained which is parameterize with the cutoff.
y.values: A list in which each entry contains the y values of the curve

APPLICATIONS OF ROC CURVE

  • Widely used in medicine, radiology, psychology; recently becoming more popular in areas like machine learning and data mining applications to assess classifiers
  • ROC analysis provides a tool to select possibly optimal models and to discard suboptimal ones[3]
  • Related to cost/benefit analysis of diagnostic decision making
  • Used to compare tests/procedures[5-6]

REFRENCES
[1] ROC Curve (OriginPro only).OrignLab Available at http://www.originlab.com/www/helponline/Origin8/en/origin.htm#stats/roc_... .Accessed on August 20,2009
[2] SIB-ROC Available at www.toodoc.com/ROC-curve-ppt.html .Accessed on August 20,2009
[3] ROC Curves & Wilcoxon and Mann-Whitney Tests Available at www.utstat.toronto.edu/.../ROC%20Curves%20&%20Wilcoxon%20and%20Mann-Whit... .Accessed on August 20,2009
[4] ROC curve in ROCR and Verification package. One R tip a day Available at http://onertipaday.blogspot.com/2007/08/receiver-operating-characteristi... .Accessed on August 20,2009
[5] ROC curve. OrignLab Available at http://www.originlab.com/index.aspx?s=8&lm=322&pid=1076 .Accessed on August 20,2009
[6] Receiver operating characteristic. Wikipedia The Free Encyclopedia Available at http://en.wikipedia.org/wiki/Receiver_operating_characteristic .Accessed on August 20,2009

  评论这张
 
阅读(4779)| 评论(2)

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018