我有一个简单的脚本来绘制 TPR/SP 权衡。
它产生一个类似的pdf(注意x轴数字的位置):
相关代码很可能是:
xticks(range(len(SP_list)), [i/10.0 for i in range(len(SP_list))], size='small')
整个代码是:
SN_list = [0.89451476793248941, 0.83544303797468356, 0.77215189873417722, 0.70042194092827004, 0.63291139240506333, 0.57805907172995785, 0.5527426160337553, 0.5527426160337553, 0.53586497890295359, 0.52742616033755274, 0.50632911392405067, 0.48101265822784811, 0.45569620253164556, 0.43459915611814348, 0.40084388185654007, 0.3628691983122363, 0.31223628691983124, 0.25738396624472576, 0.20253164556962025, 0.12658227848101267, 0.054852320675105488, 0.012658227848101266]
SP_list = [0.24256292906178489, 0.24780976220275344, 0.25523012552301255, 0.25382262996941896, 0.25684931506849318, 0.36533333333333334, 0.4548611111111111, 0.51778656126482214, 0.54978354978354982, 0.59241706161137442, 0.63492063492063489, 0.80851063829787229, 0.81203007518796988, 0.85123966942148765, 0.88785046728971961, 0.91489361702127658, 0.9135802469135802, 0.9242424242424242, 0.94117647058823528, 0.967741935483871, 1.0, 1.0]
figure()
xlabel('Score cutoff point')
ylabel('Percent')
plot(SP_list)
plot(SN_list)
legend(('True Positive Rate', 'Specificity'), 'upper left', prop={"size":9}, shadow=False, fancybox=False)
grid(False)
xticks(range(len(SP_list)), [i/10.0 for i in range(len(SP_list))], size='small')
savefig('SP_SN.png')