Как я могу построить кривую RO C в Python для моделей CNN для ряда пациентов?
Я получил пустую цифру, когда запускаю свой код. Как я могу решить эту ошибку? ![enter image description here](https://i.stack.imgur.com/OWOyd.png)
acc=0
fp=0
tp=0
fn=0
lastTenResult=list()
for el in interPrediction:
if(el[1]>0.5):
acc=acc+1
lastTenResult.append(1)
else:
lastTenResult.append(0)
if(len(lastTenResult)>10):
acc=acc-lastTenResult.pop(0)
if(acc>=8):
fp=fp+1
lastTenResult=list()
acc=0
lastTenResult=list()
for el in preictPrediction:
if(el[1]>0.5):
acc=acc+1
lastTenResult.append(1)
else:
lastTenResult.append(0)
if(len(lastTenResult)>10):
acc=acc-lastTenResult.pop(0)
if(acc>=8):
tp=tp+1
else:
if(len(lastTenResult)==10):
fn=fn+1
sensitivity=tp/(tp+fn)
FPR=fp/(secondsInterictalInTest/(60*60))
TPR=tp/(tp + fn)
result=result+str(i+1)+','+str(tp)+','+str(fp)+','+str(fn)+','+str(secondsInterictalInTest)+','
result=result+str(sensitivity)+','+str(FPR)+'\n'
print('True Positive, False Positive, False negative, Second of Inter in Test, Sensitivity, FPR')
print(str(tp)+','+str(fp)+','+str(fn)+','+str(secondsInterictalInTest)+','+str(sensitivity)+','+str(FPR))
with open(OutputPath, "a+") as myfile:
myfile.write(result)
x =FPR # false_positive_rate
y =TPR # true_positive_rate
# This is the ROC curve
plt.plot(x,y)
plt.show()