Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何找到真正的负值?_Python_Machine Learning_Deep Learning_Conv Neural Network - Fatal编程技术网

Python 如何找到真正的负值?

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

我正在利用CNN进行癫痫发作预测。我想在代码中找到真负值。我有真正值、假正值和假负值,但我不知道如何找到真负值。这是我的代码,解释了我是如何发现真正值、假正值和假负值的

任何帮助都将不胜感激

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不,它没有帮助