aboutsummaryrefslogtreecommitdiff
path: root/visualizer/extractor/destinations.py
blob: 967e766ed79ea4c9cdfdeea8d6b723a484fdcd26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python

from data.hdf5 import taxi_it
from visualizer import Vlist, Point


_sample_size = 5000

if __name__ == '__main__':
    points = Vlist(cluster=True)
    for line in taxi_it('train'):
        if len(line['latitude'])>0:
            points.append(Point(line['latitude'][-1], line['longitude'][-1]))
            if len(points) >= _sample_size:
                break
    points.save('destinations (cluster)')
    points.cluster = False
    points.heatmap = True
    points.save('destinations (heatmap)')