当前位置:网站首页>Complete set of machine learning classification task effect evaluation indicators (including ROC and AUC)
Complete set of machine learning classification task effect evaluation indicators (including ROC and AUC)
2022-07-27 18:36:00 【zkkkkkkkkkkkkk】
Catalog
1.1、 What is confusion matrix ?
1.2、 What does the confusion matrix look like ?
1.3、 Common binary confusion matrix
2.1、 Index of confusion matrix
2.2、 Secondary index of confusion matrix
2.2.3、 Recall rate ( sensitivity ):
2.3、 Three level indicators of confusion matrix
4.1、Python Realization ROC curve
1.1、 What is confusion matrix ?
Confusion matrix is also called error matrix (Confusion Matrix), It is used to calculate the index of classification problems . For example, classification indicators : Accuracy rate ( Accuracy rate ), Accuracy , Recall rates and so on . We can all calculate through the confusion matrix . As follows
1.2、 What does the confusion matrix look like ?
Confusion matrix is used to summarize the results of a classifier . about k Metaclassification , In fact, it is a k x k Of k Dimension table , Used to record the prediction results of the classifier .
1.3、 Common binary confusion matrix
| True for 1 | True for 0 | |
| Forecast as 1 | TP | FP |
| Forecast as 0 | FN | TN |
among :
The real sample is 1, The predicted sample result is 1. It is called true positive .(True Postive) abbreviation TP.
The real sample is 1, The predicted sample result is 0. Called false negative .(False Negative) abbreviation FN.
The real sample is 0, The predicted sample result is 1. Called false positive .(False Postive) abbreviation FP.
The real sample is 0, The predicted sample result is 0. Called true negative .(True Negative) abbreviation TN.
notes :FN The situation is actually the second kind of statistical error (Type II Error), We can understand it as letting the bad guys go ,
FP The situation is actually the first kind of statistical error (Type I Error), We can understand it as killing good people by mistake
2.1、 Index of confusion matrix
As the output result of two categories , We definitely hope our classifier is as accurate as possible . Then the corresponding confusion matrix is TP and TN The more the better , and FP and FN The less, the better. . After knowing this decision-making method , We often observe our TP and TN In the grid The amount of data .
And because the confusion matrix can only be observed TP and TN The number of , Confusion matrix, whether it is TP or TN or FP Or FN, Only the number of samples is counted . It does not completely represent the quality of the classifier . Sometimes in specific different scenes , Our focus is also different . So there are classified secondary indicators .
2.2、 Secondary index of confusion matrix
| True for 1 | True for 0 | |
| Forecast as 1 | TP | FP |
| Forecast as 0 | FN | TN |
2.2.1、 Accuracy rate :
The proportion of all samples with correct prediction in the total sample .
2.2.2、 Accuracy :
All forecasts are 1 In a sample of , Actually, it's also 1 Proportion of samples .

2.2.3、 Recall rate ( sensitivity ):
All truths are 1 In a sample of , The prediction is correct ( by 1) Proportion of samples .

2.2.4、 Specificity :
All forecasts are 1 In a sample of , True for 1 Proportion of samples

2.3、 Three level indicators of confusion matrix
2.3.1、F1-Score
According to the secondary index , It extends a three-level indicator . namely F1-score. It combines accuracy (Precision) And recall rate (Recall). The formula is as follows :

notes :F1-score It's a 0-1 Decimal between , The closer the 1 Indicates that the classification result is better .
3.1、ROC Curves and AUC area
The following figure shows one I trained and spent using logistic regression ROC diagram .

It's not hard for us to see ROC The curve is based on each sample point TPR Values and FPR value , A picture drawn . The horizontal axis is FPR, The vertical axis is TPR. Below the curve is AUC area ,AUC The value of is usually in 0.5~1 Between ,AUC The larger the area, the better ,ROC The closer the curve is to the upper left, the better .
4.1、Python Realization ROC curve
Python Of sklearn Already encapsulated ROC Interface of curve , We can directly call the incoming parameters to output .
from matplotlib import pyplot as plt
plot_roc_curve(lr, test_x, test_y) # test_x: Test sample set ;test_y: Test tag set
plt.title("ROC curve ")
plt.show()
5.1、 other
There are many machine learning classification indicators , Columns such as :PR curve ,KS value ,AR value ,KS Curves and so on .
边栏推荐
- Installation and deployment of zabbix6.0
- Together with Samsung, vivo will promote exynos980 dual-mode 5g mobile phone!
- 搭建一个简单的知识问答系统
- "Who is Huawei" documentary film series landing on BBC: exposing a large number of Ren Zhengfei's unknown experience
- Deep learning: stgcn learning notes
- [MIT 6.S081] Lec 6: Isolation & system call entry/exit 笔记
- MySQL learning Day1 DDL, DML, DQL basic query
- MySQL学习 Day2 排序查询 / 聚合函数 /分组查询 /分页查询 /约束/多表之间的关系
- Three consecutive high-frequency interview questions of redis online celebrity: cache penetration? Cache breakdown? Cache avalanche?
- 知识图谱 — pyhanlp实现命名体识别(附命名体识别代码)
猜你喜欢

深度学习:GCN(图卷积神经网络)理论学习总结

Installation and deployment of zabbix6.0
![[MIT 6.S081] Lec 6: Isolation & system call entry/exit 笔记](/img/b3/89b3688a06aa39d894376d57acb2af.png)
[MIT 6.S081] Lec 6: Isolation & system call entry/exit 笔记

2021.7.31笔记 视图

Linked list storage structure of dynamic linked list 2 stack (linkedstack Implementation)

MySQL learns the relationship between Day2 Sorting Query / aggregation function / grouping query / paging query / constraint / multiple tables
![[MIT 6.S081] Lab 3: page tables](/img/ea/94cdb4379733994adf3aa31cf2e826.png)
[MIT 6.S081] Lab 3: page tables

uniapp运行到手机(真机调试)
![[MIT 6.S081] Lab 6: Copy-on-Write Fork for xv6](/img/ca/e8c0827b13805c7c74cc41bf84c6ff.png)
[MIT 6.S081] Lab 6: Copy-on-Write Fork for xv6

3. Opencv geometric transformation
随机推荐
Deep learning - VIDEO behavior recognition: paper reading - two stream revolutionary networks for action recognition in videos
2021.8.1笔记 DBA
JPA connection database password field blob
org.apache.catalina.core.StandardContext. startInternal Context [] startup failed due to previous err
Software installation related
Random talk on GIS data (V) - geographic coordinate system
Jrs-303 usage
[MIT 6.S081] Lab 7: Multithreading
Press Google and NVIDIA! Alibaba optical 800 chip won the world's first authoritative test again
Deep learning: GCN (graph convolution neural network) theory learning summary
超实用!阿里P9私藏的Kubernetes学习笔记,看完直呼NB
JDBC learning day1:jdbc
Solve the problem that reids cannot be accessed by other IPS
C杂讲 链表初讲
2. Change color space and color detection
2021.8.6 notes jsoup
XML学习 Day1 : xml / Jsoup解析器 / selector选择器 /Xpath选择器
After being "expelled" from bitland, the Jank group said for the first time: it will return as soon as possible through legal channels!
Labels such as {@code}, {@link} and < P > in the notes
Zhanrui fresh seedlings: enable full scene applications, and massive data needs the integration of AI and IOT