aboutsummaryrefslogtreecommitdiff
path: root/train.py
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-05-07 13:16:23 -0400
committerAlex Auvolat <alex.auvolat@ens.fr>2015-05-07 13:16:23 -0400
commit1ffd1fc355f6fddcb6cd3d93c0df58513d064472 (patch)
tree8fc93f32c3f94644338093ac4a8a66d8d316d5a5 /train.py
parent1ff071800fc876eb6f2c25fe0eb1f7dc64efe0be (diff)
downloadtaxi-1ffd1fc355f6fddcb6cd3d93c0df58513d064472.tar.gz
taxi-1ffd1fc355f6fddcb6cd3d93c0df58513d064472.zip
Add target class based model for time prediction (seems to work)
Diffstat (limited to 'train.py')
-rwxr-xr-xtrain.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/train.py b/train.py
index 40449f0..4e2b983 100755
--- a/train.py
+++ b/train.py
@@ -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']):