Пример #1
0
            bestlp, bestfulldtw, bestconstdtw, bestgem = None, None, None, None

            for line in f:
                if "BESTLP=" in line:
                    bestlp=eval(line.split("=")[1])
                if "BESTFULLDTW=" in line:
                    bestfulldtw=eval(line.split("=")[1])
                if "BESTCONSDTW=" in line:
                    bestconsdtw=eval(line.split("=")[1])
                if "BESTGEM=" in line:
                    bestgem=eval(line.split("=")[1])
            
            gainresult.append((bestconsdtw[2]-bestgem[2]))
            cdtwresult.append(bestconsdtw[2])
            gemresult.append(bestgem[2])
            eucresult.append(bestlp[2])
            dtwresult.append(bestfulldtw[2])
            
    if np.mean(gainresult) < 0:
        print datasetN, "\t", ucr.datasetName(datasetN), "%1.4f +/- %1.4f" % (np.mean(gainresult), np.std(gainresult)), \
              "   %1.4f" % (np.mean(gainresult)/np.std(gainresult)), 
    else:
        print datasetN, "\t", ucr.datasetName(datasetN), " %1.4f +/- %1.4f" % (np.mean(gainresult),np.std(gainresult)), \
              "    %1.4f" % (np.mean(gainresult)/np.std(gainresult)), 
          
    print "   %1.4f +/- %1.4f" % (np.mean(cdtwresult), np.std(cdtwresult)),
    print "   %1.4f +/- %1.4f" % (np.mean(gemresult), np.std(gemresult)),
    print "   %1.4f +/- %1.4f" % (np.mean(eucresult), np.std(eucresult)),
    print "   %1.4f +/- %1.4f" % (np.mean(dtwresult), np.std(dtwresult))
Пример #2
0
            bestlp, bestfulldtw, bestconstdtw, bestgem = None, None, None, None

            for line in f:
                if "BESTLP=" in line:
                    bestlp = eval(line.split("=")[1])
                if "BESTFULLDTW=" in line:
                    bestfulldtw = eval(line.split("=")[1])
                if "BESTCONSDTW=" in line:
                    bestconsdtw = eval(line.split("=")[1])
                if "BESTGEM=" in line:
                    bestgem = eval(line.split("=")[1])

            gainresult.append((bestconsdtw[2] - bestgem[2]))
            cdtwresult.append(bestconsdtw[2])
            gemresult.append(bestgem[2])
            eucresult.append(bestlp[2])
            dtwresult.append(bestfulldtw[2])

    if np.mean(gainresult) < 0:
        print datasetN, "\t", ucr.datasetName(datasetN), "%1.4f +/- %1.4f" % (np.mean(gainresult), np.std(gainresult)), \
              "   %1.4f" % (np.mean(gainresult)/np.std(gainresult)),
    else:
        print datasetN, "\t", ucr.datasetName(datasetN), " %1.4f +/- %1.4f" % (np.mean(gainresult),np.std(gainresult)), \
              "    %1.4f" % (np.mean(gainresult)/np.std(gainresult)),

    print "   %1.4f +/- %1.4f" % (np.mean(cdtwresult), np.std(cdtwresult)),
    print "   %1.4f +/- %1.4f" % (np.mean(gemresult), np.std(gemresult)),
    print "   %1.4f +/- %1.4f" % (np.mean(eucresult), np.std(eucresult)),
    print "   %1.4f +/- %1.4f" % (np.mean(dtwresult), np.std(dtwresult))