diff options
author | Alex Auvolat <alex.auvolat@ens.fr> | 2015-05-07 13:16:23 -0400 |
---|---|---|
committer | Alex Auvolat <alex.auvolat@ens.fr> | 2015-05-07 13:16:23 -0400 |
commit | 1ffd1fc355f6fddcb6cd3d93c0df58513d064472 (patch) | |
tree | 8fc93f32c3f94644338093ac4a8a66d8d316d5a5 /train.py | |
parent | 1ff071800fc876eb6f2c25fe0eb1f7dc64efe0be (diff) | |
download | taxi-1ffd1fc355f6fddcb6cd3d93c0df58513d064472.tar.gz taxi-1ffd1fc355f6fddcb6cd3d93c0df58513d064472.zip |
Add target class based model for time prediction (seems to work)
Diffstat (limited to 'train.py')
-rwxr-xr-x | train.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -108,7 +108,7 @@ def main(): # Checkpoint('model.pkl', every_n_batches=100), Dump('model_data/' + model_name, every_n_batches=1000), LoadFromDump('model_data/' + model_name), - FinishAfter(after_epoch=42), + # FinishAfter(after_epoch=42), ] main_loop = MainLoop( @@ -124,12 +124,12 @@ def main(): outfile = open("output/test-output-%s.csv" % model_name, "w") outcsv = csv.writer(outfile) - if model.pred_vars == ['time']: + if model.pred_vars == ['travel_time']: outcsv.writerow(["TRIP_ID", "TRAVEL_TIME"]) for out in apply_model.Apply(outputs=outputs, stream=test_stream, return_vars=['trip_id', 'outputs']): time = out['outputs'] for i, trip in enumerate(out['trip_id']): - outcsv.writerow([trip, int(time[i, 0])]) + outcsv.writerow([trip, int(time[i])]) else: outcsv.writerow(["TRIP_ID", "LATITUDE", "LONGITUDE"]) for out in apply_model.Apply(outputs=outputs, stream=test_stream, return_vars=['trip_id', 'outputs']): |