### This file is only used for continuous evaluation test!from__future__importprint_functionfrom__future__importdivisionfrom__future__importabsolute_importimportosimportsyssys.path.append(os.environ['ceroot'])fromkpiimportCostKpitrain_cost_kpi=CostKpi('train_cost',0.02,0,actived=True,desc='train cost')test_cost_kpi=CostKpi('test_cost',0.02,0,actived=True,desc='test cost')tracking_kpis=[train_cost_kpi,test_cost_kpi]defparse_log(log):forlineinlog.split('\n'):fs=line.strip().split('\t')print(fs)iflen(fs)==3andfs[0]=='kpis':print("-----%s"%fs)kpi_name=fs[1]kpi_value=float(fs[2])yieldkpi_name,kpi_valuedeflog_to_ce(log):kpi_tracker={}forkpiintracking_kpis:kpi_tracker[kpi.name]=kpifor(kpi_name,kpi_value)inparse_log(log):print(kpi_name,kpi_value)kpi_tracker[kpi_name].add_record(kpi_value)kpi_tracker[kpi_name].persist()if__name__=='__main__':log=sys.stdin.read()log_to_ce(log)