mentaltasks.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:cebl 作者: idfah 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号