tttor / csipb-jamu-prj

Ijah Webserver
http://ijah.apps.cs.ipb.ac.id
MIT License
5 stars 12 forks source link

Handle invalid prediction result #119

Closed tttor closed 7 years ago

tttor commented 7 years ago

file: server_thread.py

            # Merge predictionMsg
            predictionListRaw = [] # 2D: row: method and col: ith query
            for t in predictorThreads:
                predictionListRaw.append( t.getPredictionList() )

            predictionList = []
            for i in range(len(queryList)):
                nMethods = len(pcfg['methods'])
                normalizer = 1.0/float(nMethods)
                nPred = 0.0
                for j in range(nMethods):
                    w = pcfg['methods'][j][1]
                    nPred += normalizer * w * predictionListRaw[j][i]
                predictionList.append(nPred)
            # print self.name+': predictionList '+str(predictionList)
tttor commented 7 years ago

Done.