論文ROC曲線畫(huà)圖-標(biāo)注重要點(diǎn)

image.png
from sklearn.metrics import auc
import pandas as pd
import matplotlib.pyplot as plt

df = pd.read_csv('/Users/yh/Desktop/roc/df_xy.csv', )
fpr_1 = df['x'].values
tpr = df['y'].values

print(auc(fpr_1, tpr))


x2 = 1 - 0.78
y2 = 0.94
x22 = 1-0.84
y22 = 0.98

x1 = 1-0.92
y1 = 0.94
x11 = 1-1
y11 = 0.92

x3 = 1-0.8
y3 = 0.34
x33 = 1-0.92
y33 = 0.88

plt.rcParams['savefig.dpi'] = 300 #圖片像素
plt.rcParams['figure.dpi'] = 300 #分辨率

plt.plot(fpr_11, tpr1)
plt.scatter(x1, y1, c='lightgreen')
plt.scatter(x11, y11, c='lightgreen')
plt.scatter(x2, y2, c='g')
plt.scatter(x22, y22, c='g')
plt.scatter(x3, y3, c='orange')
plt.scatter(x33, y33, c='orange')
plt.annotate(s="", xy=(x11, y11), xytext=(x1, y1),arrowprops={"arrowstyle":"->"}) # 1
plt.annotate(s="", xy=(x22, y22), xytext=(x2, y2),arrowprops={"arrowstyle":"->"}) # 2
plt.annotate(s="", xy=(x33, y33), xytext=(x3, y3),arrowprops={"arrowstyle":"->"}) # 3
plt.xlabel('1 - specific')
plt.ylabel('sensitivity')
plt.title('ROC')
plt.text(0.58, 0.3, 'ROC curve(area = 0.990)')
plt.ylim(0, 1.1)
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容