P-R曲线绘制的详细例子
P-R曲线绘制详细例子
P-R曲线可用来度量一个机器学习器的优劣,了解P-R曲线的绘制过程,对理解查全率和查准率非常有帮助。这里举一个简单的例子,手动绘制P-R曲线,例子选取了21个训练样本,样本如下:
(1,0.785753721910176)
(1,0.356605631195716)
(1,0.293302128059673)
(1,0.664535310077594)
(1,0.32345789365851)
(1,0.069257919860597)
(0,0.86868771097342)
(1,0.447009292311432)
(0,0.244938706127235)
(1,0.662406288116686)
(1,0.61022033847474)
(0,0.503814453792609)
(0,0.869789994280106)
(0,0.43055972494908)
(1,0.799355881086056)
(1,0.920925878408794)
(1,0.746129894485301)
(0,0.0136492702486322)
(0,0.360680722886583)
(0,0.356315426920846)
(1,0.226843835526905)
每个括号第一个数表示这个样本是否是正例(为1是正例,为0是负例),第二个数表示样本通过学习器计算得到是“该样本是正例”的概率,概率越大,表示该推测该样本更可能是一个正例。现在,按如下步骤处理这些样本。
样本按概率排序
为便于分析,我们将样本按照概率