当前位置:网站首页>Calculation method of AUC
Calculation method of AUC
2022-07-03 05:17:00 【Qianyu QY】
About AUC Part of the understanding and calculation can refer to :https://blog.csdn.net/lieyingkub99/article/details/81266664?utm_medium=distribute.pc_relevant.none-task-blog-title-1&spm=1001.2101.3001.4242
But the above calculation AUC The explanation of the second method is not very good , Let's understand here .
Based on Method 1 above :
(1) Suppose there is M M M A positive sample , N N N Negative samples , Positive and negative samples are combined in pairs , common M ∗ N M*N M∗N Group .
(2) initialization P = 0 P=0 P=0. Two classifiers are used to predict two samples of each group ,
If the classifier predicts The probability that the positive sample is a positive sample is greater than the probability that the negative sample is a positive sample , be P + 1 P+1 P+1;
If the classifier predicts The probability that the positive sample is a positive sample is less than the probability that the negative sample is a positive sample , be P P P unchanged ;
If the classifier predicts The probability that the positive sample is a positive sample is equal to the probability that the negative sample is a positive sample , be P + 0.5 P+0.5 P+0.5.
(3) A U C = P / ( M ∗ N ) AUC=P/(M*N) AUC=P/(M∗N).
Deform method 1 , Get formula method 2 :
(1) Use two classifiers to predict all positive and negative samples , Get the probability that they are positive samples ;
(2) Sort according to the probability from small to large ;
(3) Give each sample an attribute R R R, R R R Indicates the number of samples whose probability is less than this sample +1.
For example 100 Samples , The probability of a sample is the highest , by 0.99, Of this sample R = 100 R=100 R=100. R R R At the same time, it is equal to the index of the sorted sample +1.
(4) For positive samples with the greatest probability , R R R Equal to the sum of the number of positive and negative samples whose probability is less than this sample +1, The number of positive samples is M − 1 M-1 M−1, Then the number of negative samples is R 1 − ( M − 1 ) − 1 = R 1 − M R_1-(M-1)-1=R_1-M R1−(M−1)−1=R1−M.
For positive samples with the second largest probability , R R R Equal to the sum of the number of positive and negative samples whose probability is less than this sample +1, The number of positive samples is M − 2 M-2 M−2, Then the number of negative samples is R 2 − ( M − 2 ) − 1 = R 2 − ( M − 1 ) R_2-(M-2)-1=R_2-(M-1) R2−(M−2)−1=R2−(M−1).
By analogy , consider AUC Is the sum of the number of groups in which the probability of positive samples is greater than the probability of negative samples , Divided by M ∗ N M*N M∗N. Then the probability of positive samples is greater than the sum of the number of groups of the probability of negative samples , be equal to [ R 1 − M ] + [ R 2 − ( M − 1 ) ] + [ R 3 − ( M − 2 ) ] + . . . + [ R m − ( 1 ) ] [R_1-M]+[R_2-(M-1)]+[R_3-(M-2)]+...+[R_m-(1)] [R1−M]+[R2−(M−1)]+[R3−(M−2)]+...+[Rm−(1)].
According to the summation formula : 1 + 2 + . . + M = M ∗ ( 1 + M ) / 2 1+2+..+M=M*(1+M)/2 1+2+..+M=M∗(1+M)/2,
A U C = [ s u m ( R i ) + M ∗ ( 1 + M ) / 2 ] / M ∗ N AUC=[sum(R_i)+M*(1+M)/2]/M*N AUC=[sum(Ri)+M∗(1+M)/2]/M∗N.
(5) When the probability of positive and negative samples is equal , Of this positive sample R i R_i Ri Equal to all that have the same probability R R R The average of .
边栏推荐
- Overview of basic knowledge of C language
- Hotel public broadcasting background music - Design of hotel IP network broadcasting system based on Internet +
- leetcode452. Detonate the balloon with the minimum number of arrows
- 聊聊如何利用p6spy进行sql监控
- 联想R7000显卡的拆卸与安装
- 6.23星期四库作业
- 3dslam with 16 line lidar and octomap
- Use posture of sudo right raising vulnerability in actual combat (cve-2021-3156)
- Common interview questions of microservice
- 1114 family property (25 points)
猜你喜欢
[practical project] autonomous web server
音频焦点系列:手写一个demo理解音频焦点与AudioMananger
Detailed explanation of the output end (head) of yolov5 | CSDN creation punch in
Yolov5 model construction source code details | CSDN creation punch in
Webrtc native M96 version opening trip -- a reading code download and compilation (Ninja GN depot_tools)
【批处理DOS-CMD命令-汇总和小结】-CMD窗口的设置与操作命令-关闭cmd窗口、退出cmd环境(exit、exit /b、goto :eof)
Class loading mechanism (detailed explanation of the whole process)
Go practice -- design patterns in golang's singleton
XML Configuration File
Common interview questions of microservice
随机推荐
[set theory] relationship properties (common relationship properties | relationship properties examples | relationship operation properties)
appium1.22.x 版本後的 appium inspector 需單獨安裝
2022-02-11 daily clock in: problem fine brush
Introduction to deep learning (II) -- univariate linear regression
Explanation of variables, code blocks, constructors, static variables and initialization execution sequence of static code blocks of Ali interview questions
"250000 a year is just the price of cabbage" has become a thing of the past. The annual salary of AI posts has decreased by 8.9%, and the latest salary report has been released
2022-02-12 daily clock in: problem fine brush
最大连续子段和(动态规划,递归,递推)
Basic knowledge of reflection (detailed explanation)
Kept hot standby and haproxy
小学校园IP网络广播-基于校园局域网的小学IP数字广播系统设计
(完美解决)matplotlib图例(legend)如何自由设置其位置
乾元通多卡聚合路由器的技术解析
Go language interface learning notes Continued
Introduction to rust Foundation (basic type)
Handler understands the record
编译GCC遇到的“pthread.h” not found问题
[backtrader source code analysis 4] use Python to rewrite the first function of backtrader: time2num, which improves the efficiency by 2.2 times
Go practice -- gorilla/rpc (gorilla/rpc/json) used by gorilla web Toolkit
BIO、NIO、AIO区别