def testClassify(self):
# a little extra (0.9*self.pauseSecs) for edge effects in filter XXX - idfah
cap = self.src.getEEGSecs(self.width+0.9*self.pauseSecs).copy(dtype=np.float32) # get rid of copy and dtype after implementing in source XXX - idfah
cap = cap.trim(start=0.9*self.pauseSecs)
seg = cap.segmentSingle()
if self.method == 'Welch Power':
freqs, testData = self.powerize((seg,))
else:
testData = (seg.data,)
testDataStd = self.stand.apply(testData)[0]
label = self.classifier.label(testDataStd)[0]
selection = self.choices[label]
self.pieMenu.growBar(selection, self.gain, refresh=True)
self.curDecision += 1
finalSelection = self.pieMenu.getSelection()
if finalSelection is None:
wx.CallAfter(self.runTestEpoch)
else:
self.pieMenu.clearAllHighlights(refresh=False)
self.pieMenu.highlight(finalSelection, style='jump', secs=self.pauseSecs)
finalLabel = self.choices.index(finalSelection)
self.src.incrementMarker(finalLabel+1)
self.confusion[finalLabel, self.choices.index(self.curChoice)] += 1.0
wx.CallLater(1000.0*self.pauseSecs, self.testClearTrial)
评论列表
文章目录