I am working on epilepsy seizure prediction using CNN. I want to find True negative value in my code.I have true positive,false positive and false negative but I don't know how to find true negative value. That's my code explain how I found true positive,false positive and false negative values.
Any help would be appreciated.
interPrediction=model.predict_generator(generate_arrays_for_predict(indexPat, filesPath), max_queue_size=4, steps=len(filesPath))
preictPrediction=model.predict_generator(generate_arrays_for_predict(indexPat, filesPath), max_queue_size=4, steps=len(filesPath))
acc=0 #accumulator
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