taxi

Winning entry to the Kaggle taxi competition
git clone https://esimon.eu/repos/taxi.git
Log | Files | Refs | README

commit 028402e4a2fafc39cc8fc0e036e79017b9f9c26a
parent 9313c8bb7f62b14f8c15d2119ae678641f751dbd
Author: Alex Auvolat <alex.auvolat@ens.fr>
Date:   Thu, 23 Jul 2015 10:15:54 -0400

Zero padding for test output files

Diffstat:
Mext_test.py | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ext_test.py b/ext_test.py @@ -26,7 +26,7 @@ class RunOnTest(SimpleExtension): self.function = cg.get_theano_function() def do(self, which_callback, *args): - iter_no = repr(self.main_loop.log.status['iterations_done']) + iter_no = self.main_loop.log.status['iterations_done'] if 'valid_destination_cost' in self.main_loop.log.current_row: dvc = self.main_loop.log.current_row['valid_destination_cost'] elif 'valid_model_cost_cost' in self.main_loop.log.current_row: @@ -46,13 +46,13 @@ class RunOnTest(SimpleExtension): raise RuntimeError("Unknown model type") if 'destination' in self.outputs: - dest_outname = 'test-dest-%s-it%s-cost%.3f.csv' % (self.model_name, iter_no, dvc) + dest_outname = 'test-dest-%s-it%09d-cost%.3f.csv' % (self.model_name, iter_no, dvc) dest_outfile = open(os.path.join('output', dest_outname), 'w') dest_outcsv = csv.writer(dest_outfile) dest_outcsv.writerow(["TRIP_ID", "LATITUDE", "LONGITUDE"]) logger.info("Generating output for test set: %s" % dest_outname) if 'duration' in self.outputs: - time_outname = 'test-time-%s-it%s-cost%.3f.csv' % (self.model_name, iter_no, tvc) + time_outname = 'test-time-%s-it%09d-cost%.3f.csv' % (self.model_name, iter_no, tvc) time_outfile = open(os.path.join('output', time_outname), 'w') time_outcsv = csv.writer(time_outfile) time_outcsv.writerow(["TRIP_ID", "TRAVEL_TIME"])