Python 如何找到真正的负值?
我正在利用CNN进行癫痫发作预测。我想在代码中找到真负值。我有真正值、假正值和假负值,但我不知道如何找到真负值。这是我的代码,解释了我是如何发现真正值、假正值和假负值的 任何帮助都将不胜感激Python 如何找到真正的负值?,python,machine-learning,deep-learning,conv-neural-network,Python,Machine Learning,Deep Learning,Conv Neural Network,我正在利用CNN进行癫痫发作预测。我想在代码中找到真负值。我有真正值、假正值和假负值,但我不知道如何找到真负值。这是我的代码,解释了我是如何发现真正值、假正值和假负值的 任何帮助都将不胜感激 interPrediction=model.predict_generator(generate_arrays_for_predict(indexPat, filesPath), max_queue_size=4, steps=len(filesPath)) preictPrediction=model.p
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
这有帮助吗:?@Pygirl我的代码中没有
x\u train
和y\u train
。我使用的是模型。安装发电机@Pygirl不,这没有帮助吗?@Pygirl我的代码中没有x\u列和y\u列。我使用的是模型。安装发电机@Pygirl不,它没有帮助