为什么正负样本差距比较大的时候使用ROC曲线能比较准确的评估模型性能、auc和roc的关系以及为什么,auc能评判模型好坏
混淆矩阵、横轴 实际正样本、实际负样本、纵轴预测正样本、预测负样本
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504034032.png)
enter description here
PR曲线是什么、样本均衡的时候使用PR有什么好处
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504142281.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504146913.png)
ROC好处不均衡样本使用衡量较准确的原因
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504226682.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504180004.png)
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504183194.png)
a,c为ROC曲线,b,d为PR曲线。(a)和(b)展示的是分类其在原始测试集(正负样本分布平衡)的结果,(c)(d)是将测试集中负样本的数量增加到原来的10倍后,分类器的结果,可以明显的看出,ROC曲线基本保持原貌,而PR曲线变化较大
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504273981.png)
enter description here
auc是roc曲线的积分值,显示在tpr和fpr的关系、最理想肯定是tpr=1,fpr=0,所以auc是评判tpr和fpr关系的,值也叫阈值auc重叠取真值的最大阈值
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504840021.png)
enter description here
如何画auc图
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504843308.png)
enter description here
![enter description here enter description here](https://raw.githubusercontent.com/miaozhijuan/xiaoshujiang/master/%E5%B0%8F%E4%B9%A6%E5%8C%A0/1586504850871.png)