Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to draw ROC curve with pROC package

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to use pROC package to draw ROC curve" related knowledge, editor through the actual case to show you the operation process, the method of operation is simple and fast, practical, I hope that this "how to use pROC package to draw ROC curve" article can help you solve the problem.

R package pROC can be used for ROC curve analysis, and the main functions involved are roc function and plot.roc function.

Take your own data as an example:

> library (pROC) > data ("aSAH") > head (aSAH) 10) gos6 outcome gender age wfns s100b ndka29 5 Good Female 42 1 0.13 3.0130 5 Good Female 37 1 0.14 8.5431 5 Good Female 42 1 0.10 8.0932 5 Good Female 27 10.04 10.4233 1 Poor Female 423 0.13 17.4034 1 Poor Male 48 2 0.10 12.7535 4 Good Male 57 5 0.47 6.0036 1 Poor Male 41 40 . 16 13.2037 5 Good Female 49 1 0.18 15.5438 4 Good Female 75 2 0.10 6.01

According to the data display, select s100b to analyze the outcome

> outcome=roc (response=aSAH$outcome,predictor = aSAH$s100b) > outcomeCall:roc.default (response=aSAH$outcome,predictor = aSAH$s100b) Data: aSAH$s100b in 72 controls (aSAH$outcome Good)

< 41 cases (aSAH$outcome Poor).Area under the curve: 0.7314 基于返回结果绘制ROC曲线 plot.roc(outcome) 简单进行美化 >

Plot.roc (outcome,col= "red", print.auc = TRUE,print.auc.col = "darkgreen", auc.polygon = TRUE,auc.polygon.col = "pink") on "how to use the pROC package to draw ROC curve" content here, thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report