[問題] 取值問題
底下是我的簡易程式碼
def main():
done_jobs = {}
result_file = open(out_filename,'w',0)
db = []
best_mape = 100000000
for line in jobs:
for (c,g,p) in line:
while not done_jobs.has_key((c,g,p)):
(worker,c1,g1,p1,mape) = result_queue.get()
done_jobs[(c1,g1,p1)] = mape
result_file.write('%s %s %s %s\n' %(c1,g1,p1,mape))
result_file.flush()
print "[%s] %s %s %s %s" % (worker,c1,g1,p1,mape),
if mape < best_mape:
best_mape = mape
best_c = 2.0**c1
best_g = 2.0**g1
best_p = 2.0**p1
print " (best c=%s, g=%s, p=%s, MAPE=%s)" % \
(best_c, best_g, best_p, best_mape)
main()
如果我要取main中的mape值,我該如何取阿?試好久都試不出來 @@""
先謝謝高手的解答
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.23.28.28
推
04/04 01:50, , 1F
04/04 01:50, 1F
Python 近期熱門文章
PTT數位生活區 即時熱門文章