def debug_show_eval_result(\
            picklefilename,\
            target_recname = None,\
            singleRecordFile = False\
        ):
    with open(picklefilename, 'r') as fin:
        Results = pickle.load(fin)
    # convert to a list
    if singleRecordFile == True:
        Results = [
            Results,
        ]
    for recind in xrange(0, len(Results)):
        # only plot target rec
        if target_recname is not None:
            print 'Current FileName: {}'.format(Results[recind][0])
            if Results[recind][0] != target_recname:
                return
        fResults = ECGRF.ECGrf.resfilter(Results)
        #
        # show filtered results & raw results
        # Evaluate prediction result statistics
        #

        ECGstats = ECGstatistics(fResults[recind:recind + 1])
        ECGstats.eval(debug=False)
        ECGstats.dispstat0()
        ECGstats.plotevalresofrec(Results[recind][0], Results)
Пример #2
0
 def plot(self):
     Results = [
         (self.recname, self.testresult),
     ]
     fResults = ECGRF.ECGrf.resfilter(Results)
     #
     # show filtered results & raw results
     # Evaluate prediction result statistics
     #
     recind = 0
     ECGstats = ECGstatistics(fResults[recind:recind + 1])
     ECGstats.eval(debug=False)
     ECGstats.dispstat0()
     ECGstats.plotevalresofrec(Results[recind][0], Results)
Пример #3
0
    def RFtest(self, testrecname):
        ecgrf = ECGRF()
        sel1213 = conf['sel1213']
        ecgrf.training(sel1213)
        Results = ecgrf.testing([
            testrecname,
        ])
        # Evaluate result
        filtered_Res = ECGRF.resfilter(Results)
        stats = ECGstats(filtered_Res[0:1])
        Err, FN = stats.eval(debug=False)

        # write to log file
        EvalLogfilename = os.path.join(projhomepath, 'res.log')
        stats.dispstat0(\
                pFN = FN,\
                pErr = Err)
        # plot prediction result
        stats.plotevalresofrec(Results[0][0], Results)
Пример #4
0
def debug_show_eval_result(\
            picklefilename,\
            target_recname = None\
        ):
    with open(picklefilename,'r') as fin:
        Results = pickle.load(fin)
    # only plot target rec
    if target_recname is not None:
        print Results[0][0]
        if Results[0][0]!= target_recname:
            return 
    fResults = ECGRF.ECGrf.resfilter(Results)
    #
    # show filtered results & raw results
    # Evaluate prediction result statistics
    #

    ECGstats = ECGstatistics(fResults[0:1])
    ECGstats.eval(debug = False)
    ECGstats.dispstat0()
    ECGstats.plotevalresofrec(Results[0][0],Results)