From defab74395f2ddb2641bba6ab8d18bdedde7a334 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 29 Jul 2015 12:06:00 -0400 Subject: p-value caluculation script --- data/make_reference_output.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 data/make_reference_output.py (limited to 'data/make_reference_output.py') diff --git a/data/make_reference_output.py b/data/make_reference_output.py new file mode 100755 index 0000000..1cd31ae --- /dev/null +++ b/data/make_reference_output.py @@ -0,0 +1,28 @@ +#!/usr/bin/env python + +import csv +import os + +from fuel.iterator import DataIterator +from fuel.schemes import SequentialExampleScheme +from fuel.streams import DataStream + +from data.hdf5 import TaxiDataset +import data + +dest_outfile = open(os.path.join(data.path, 'test_answer.csv'), 'w') +dest_outcsv = csv.writer(dest_outfile) +dest_outcsv.writerow(["TRIP_ID", "LATITUDE", "LONGITUDE"]) + +dataset = TaxiDataset('test', 'tvt.hdf5', + sources=('trip_id', 'longitude', 'latitude', + 'destination_longitude', 'destination_latitude')) +it = DataIterator(DataStream(dataset), iter(xrange(dataset.num_examples)), as_dict=True) + +for v in it: + # print v + dest_outcsv.writerow([v['trip_id'], v['destination_latitude'], + v['destination_longitude']]) + +dest_outfile.close() + -- cgit v1.2.3