From b038c9fff51c3dd448034e0e5f88616a82bfcffd Mon Sep 17 00:00:00 2001 From: Your Name <you@example.com> Date: Fri, 14 Jun 2019 11:07:38 +0800 Subject: [PATCH] predict add sample id --- eda/esmm/Model_pipline/train.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eda/esmm/Model_pipline/train.py b/eda/esmm/Model_pipline/train.py index 461221ee..c530a323 100644 --- a/eda/esmm/Model_pipline/train.py +++ b/eda/esmm/Model_pipline/train.py @@ -362,7 +362,7 @@ def main(_): preds = Estimator.predict(input_fn=lambda: input_fn(te_files, num_epochs=1, batch_size=FLAGS.batch_size), predict_keys=["pctcvr","pctr","pcvr","sample_id"]) with open(FLAGS.local_dir + "/pred.txt", "w") as fo: for prob in preds: - fo.write("%f\t%f\t%f\t%d\n" % (prob['pctr'], prob['pcvr'], prob['pctcvr'], prob["sample_id"])) + fo.write("%f\t%f\t%f\t%s\n" % (prob['pctr'], prob['pcvr'], prob['pctcvr'], prob["sample_id"])) elif FLAGS.task_type == 'export': print("Not Implemented, Do It Yourself!") -- 2.18.0