This commit is contained in:
王庆刚
2024-11-04 18:06:52 +08:00
parent dfb2272a15
commit 5ecc1285d4
41 changed files with 2552 additions and 440 deletions

View File

@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
"""
Created on Wed Sep 11 11:57:30 2024
永辉现场 1:1 比对测试
永辉现场试验输出数据的 1:1 性能评估
适用于202410前数据保存版本的需调用 OneToOneCompare.txt
@author: ym
"""
import os
@ -65,14 +64,14 @@ def plot_pr_curve(matrix):
axs[1].set_title(f'Cross Barcode, Num: {TPFN_mean}')
# plt.savefig(f'./result/{file}_hist.png') # svg, png, pdf
Recall_Pos = []
Recall_Neg = []
Thresh = np.linspace(-0.2, 1, 100)
for th in Thresh:
TN = np.sum(simimax < th)
Recall_Pos.append(TN/TPFN_max)
Recall_Neg.append(TN/TPFN_max)
fig, ax = plt.subplots()
ax.plot(Thresh, Recall_Pos, 'b', label='Recall_Pos: TP/TPFN')
ax.plot(Thresh, Recall_Neg, 'b', label='Recall_Pos: TP/TPFN')
ax.set_xlim([0, 1])
ax.set_ylim([0, 1])
ax.grid(True)
@ -96,9 +95,7 @@ def main():
simiList = []
for fp in filepaths:
slist = read_one2one_data(fp)
simiList.extend(slist)
plot_pr_curve(simiList)