├── LICENSE.md
├── README.md
├── auxiliaryfunctions.py
├── best_classifier.py
├── classifytraj.py
├── datacleaning.py
├── down_left_point.py
├── fast_dtw_neigbors.py
├── grid_points.py
├── lcss_neighbors.py
├── requirements.txt
├── test_set.csv
├── test_set_a1.csv
├── test_set_a2.csv
└── train_set.csv.zip
/LICENSE.md:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "{}"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright {yyyy} {name of copyright owner}
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Trajectory Analysis and Classification in Python (Pandas and Scikit Learn)
2 |
3 | A university project for the postgraduate class of Data Mining.
4 |
5 | We were given a train_set with geographical points paired with the time interval. Firstly, we cleaned the dataset and then we formed the trajectories (with the corresponding route id). The last step of this part was to filter out some trajectories based on _their total_distance and max distance (between two of their points).
6 |
7 | The goal of this project was firstly to compute trajectory similarity between trajectories of test_set_a1/a2.csv and the train_set.csv.
8 |
9 | The algorithms used for that were :
10 | 1) Fast Dynamic Time Warping (Fast-DTW), taken from https://github.com/slaypni/fastdtw
11 | 2) Longest Common Subsequence algorithm, which i implemented.
12 |
13 | The distance taken into account each time, was the Havershine distance of the points. Files lcss_neighbors.py and fast_dtw_neighbors.py read the corresponding trajectories from test_set_a1/a2.csv and find the 5 most 'similar' trajectories from the cleaned dataset. Finally, they plot them with some specific metrics of similarity.
14 |
15 | The second part of the project was to train KNN,Random Forest, and Logistic Regression classifiers and predict the routes of trajectories of the test_set.csv . The first step was to assign each trajectory to a string (composed of cell codes) via a grid representation. In the second step, 10-cross-fold-validation was used to train the classifiers with grid strings of the dataset with accuracy metric . I conducted various experiments, by changing each classifier's parameters.
16 |
17 | Lastly,the classifiers with the best accuracy were bunched together in the Voting Classifier. The final classifier was used to find labels for the trajectories of the test_set.csv .
18 |
--------------------------------------------------------------------------------
/auxiliaryfunctions.py:
--------------------------------------------------------------------------------
1 | import gmplot
2 | from math import sin, cos, sqrt, atan2, radians
3 |
4 |
5 | def haversine_np(pointa, pointb):
6 | # approximate radius of earth in km
7 |
8 | R = 6373.0
9 |
10 | lat1 = radians(pointa[2])
11 | lon1 = radians(pointa[1])
12 | lat2 = radians(pointb[2])
13 | lon2 = radians(pointb[1])
14 |
15 | dlon = lon2 - lon1
16 | dlat = lat2 - lat1
17 |
18 | a = sin(dlat / 2) ** 2 + cos(lat1) * cos(lat2) * sin(dlon / 2) ** 2
19 | c = 2 * atan2(sqrt(a), sqrt(1 - a))
20 |
21 | distance = R * c
22 |
23 | # print("Result:", distance)
24 | return distance
25 |
26 |
27 | def compute_distances(trajectory):
28 | maxel = 0.0
29 | total_dst = 0.0
30 |
31 | for i in range(0, len(trajectory) - 1):
32 | dist = 0.0
33 | dist = haversine_np(trajectory[i], trajectory[i + 1])
34 | if dist > maxel:
35 | maxel = dist
36 | total_dst += dist
37 | return [total_dst, maxel]
38 |
39 |
40 | def plot_traj(df_traj, plotname):
41 | longtitudes = []
42 | latitudes = []
43 | for elem2 in df_traj:
44 | longtitudes.append(elem2[1])
45 | latitudes.append(elem2[2])
46 | # now let's plot:
47 | gmap = gmplot.GoogleMapPlotter(latitudes[0], longtitudes[0], len(df_traj))
48 | gmap.plot(latitudes, longtitudes, 'cornflowerblue', edge_width=10)
49 | gmap.draw(plotname + ".html")
50 |
51 |
52 | def plot_traj_red(com_points, df_traj, plotname):
53 | longtitudes = []
54 | latitudes = []
55 | for elem2 in df_traj:
56 | longtitudes.append(elem2[1])
57 | latitudes.append(elem2[2])
58 | # now let's plot:
59 | gmap = gmplot.GoogleMapPlotter(latitudes[0], longtitudes[0], 12)
60 | gmap.plot(latitudes, longtitudes, 'cornflowerblue', edge_width=10)
61 |
62 |
63 | longtitudes = []
64 | latitudes = []
65 | for elem2 in com_points:
66 | longtitudes.append(elem2[1])
67 | latitudes.append(elem2[2])
68 | # now let's plot:
69 | gmap.plot(latitudes, longtitudes, 'red', edge_width=10)
70 |
71 | gmap.draw(plotname + ".html")
72 |
73 |
74 | def print_results(df_traj, distances, index, name):
75 | target_traj_coordinates = df_traj['timestamp_longitude_latitude'].iloc[index] # get target trajectory
76 | target_journeypattid = df_traj['JourneyPatternId'].iloc[index] # get target journey pattern id
77 |
78 | print
79 | "Traj: " + str(target_journeypattid) + "Distance is %.4f km's." % distances[index]
80 | plot_traj(target_traj_coordinates, name)
81 |
82 |
83 | def lcss_trigger(traj, df, trigger, index):
84 | # if trigger==1 then it returns the # of matching points
85 | if (trigger == 1):
86 | matching_points = []
87 | count = 0;
88 | for elem in df['timestamp_longitude_latitude']:
89 | n0 = len(traj)
90 | n1 = len(elem)
91 | # An (m+1) times (n+1) matrix
92 | C = [[0] * (n1 + 1) for _ in range(n0 + 1)]
93 | for i in range(1, n0 + 1):
94 | for j in range(1, n1 + 1):
95 | if haversine_np(traj[i - 1], elem[j - 1]) <= 0.2:
96 | C[i][j] = C[i - 1][j - 1] + 1
97 | else:
98 | C[i][j] = max(C[i][j - 1], C[i - 1][j])
99 | matching_points.append(C[n0][n1])
100 | count = count + 1
101 | elif (trigger == 2): # else it returns the list of common points of traj with df[index] traj
102 | common_points = []
103 | elem = df['timestamp_longitude_latitude'].iloc[index]
104 | n0 = len(traj)
105 | n1 = len(elem)
106 | # An (m+1) times (n+1) matrix
107 | C = [[0] * (n1 + 1) for _ in range(n0 + 1)]
108 | for i in range(1, n0 + 1):
109 | for j in range(1, n1 + 1):
110 | if haversine_np(traj[i - 1], elem[j - 1]) <= 0.2:
111 | C[i][j] = C[i - 1][j - 1] + 1
112 | if (elem[j - 1] not in common_points):
113 | common_points.append(elem[j - 1])
114 | else:
115 | C[i][j] = max(C[i][j - 1], C[i - 1][j])
116 | if (trigger == 1):
117 | return matching_points
118 | else:
119 | return common_points
120 |
--------------------------------------------------------------------------------
/best_classifier.py:
--------------------------------------------------------------------------------
1 | from sklearn.linear_model import SGDClassifier
2 | from sklearn.feature_extraction.text import CountVectorizer
3 | from sklearn.feature_extraction.text import TfidfTransformer
4 | import pandas as pd
5 | from sklearn.decomposition import TruncatedSVD
6 | from sklearn import preprocessing
7 | from sklearn.pipeline import Pipeline
8 | from sklearn.grid_search import GridSearchCV
9 | from sklearn import metrics
10 |
11 | import numpy as np
12 | from sklearn.neighbors import KNeighborsClassifier
13 | from sklearn.ensemble import RandomForestClassifier
14 | import csv
15 | #k-fold cross validation
16 | from sklearn.cross_validation import KFold
17 | #accuracy
18 | from sklearn.metrics import accuracy_score
19 |
20 |
21 | # my method
22 | from sklearn.ensemble import VotingClassifier
23 |
24 |
25 | def compute_and_print(): #prints all results
26 | stats = []
27 | for i, (train_index, test_index) in enumerate(kf):
28 | #10-fold cross validation (9 samples for training, 1 for testing)
29 | X_train1, X_test = X_train[train_index], X_train[test_index]
30 | Y_train1, Y_test = Y_train[train_index], Y_train[test_index]
31 | probas_ = pipeline.fit(X_train1,Y_train1).predict(X_test)
32 | stats.append(accuracy_score(Y_test, probas_))
33 | return stats
34 |
35 |
36 | ''' preprocessing:
37 | apart from CountVectorizer and TfidfTransformer TruncatedSVD of 300 elements and random state 42'''
38 |
39 | df=pd.read_csv("grids.csv")
40 | #print df
41 |
42 | le = preprocessing.LabelEncoder()
43 | le.fit(df["TripId"])
44 | Y_train=le.transform(df["TripId"])
45 | X_train1=df['Grids']
46 |
47 |
48 |
49 | X_train=np.array(X_train1)
50 |
51 | vectorizer=CountVectorizer()
52 | transformer=TfidfTransformer()
53 | svd=TruncatedSVD(n_components=300, random_state=42)
54 | kf = KFold(len(X_train), n_folds=10)
55 |
56 | #Our best method
57 | # voting classifier of 3 classifiers
58 | '''1 best version of KNN
59 | 2 simple RandomForestClassifier
60 | 3 Best RandomForestClassifier'''
61 |
62 | #My method---Voting Classifier
63 | clf1 = RandomForestClassifier(n_estimators=40,n_jobs=-1)
64 | clf2 = RandomForestClassifier(n_estimators=50,n_jobs=-1)
65 | clf3 = KNeighborsClassifier(n_neighbors=7,n_jobs=-1)
66 | clf = VotingClassifier(estimators=[('rf1',clf1),('rf2',clf2),('knn',clf3)], voting='hard')
67 | pipeline = Pipeline([
68 | ('vect', vectorizer),
69 | ('tfidf', transformer),
70 | ('svd',svd),
71 | ('clf', clf)
72 | ])
73 |
74 | print compute_and_print()
75 |
--------------------------------------------------------------------------------
/classifytraj.py:
--------------------------------------------------------------------------------
1 | from sklearn.linear_model import SGDClassifier
2 | from sklearn.feature_extraction.text import CountVectorizer
3 | from sklearn.feature_extraction.text import TfidfTransformer
4 | import pandas as pd
5 | from sklearn.decomposition import TruncatedSVD
6 | from sklearn import preprocessing
7 | from sklearn.pipeline import Pipeline
8 |
9 |
10 | import numpy as np
11 | from sklearn.neighbors import KNeighborsClassifier
12 | from sklearn.linear_model import LogisticRegression
13 | from sklearn.ensemble import RandomForestClassifier
14 | import csv
15 | #k-fold cross validation
16 | from sklearn.cross_validation import KFold
17 | #accuracy
18 | from sklearn.metrics import accuracy_score
19 |
20 |
21 | # my method
22 | from sklearn.ensemble import VotingClassifier
23 |
24 |
25 | def compute_and_print(): #prints all results
26 | stats = []
27 | for i, (train_index, test_index) in enumerate(kf):
28 | #10-fold cross validation (9 samples for training, 1 for testing)
29 | X_train1, X_test = X_train[train_index], X_train[test_index]
30 | Y_train1, Y_test = Y_train[train_index], Y_train[test_index]
31 | probas_ = pipeline.fit(X_train1,Y_train1).predict(X_test)
32 | stats.append(accuracy_score(Y_test, probas_))
33 | return stats
34 | stats = []
35 | stats1 = []
36 | stats2 = []
37 | stats3 = []
38 |
39 | #Read Data
40 | df=pd.read_csv("grids.csv")
41 | #print df
42 |
43 | le = preprocessing.LabelEncoder()
44 | le.fit(df["TripId"])
45 | Y_train=le.transform(df["TripId"])
46 | X_train1=df['Grids']
47 |
48 |
49 |
50 | X_train=np.array(X_train1)
51 |
52 | vectorizer=CountVectorizer()
53 | transformer=TfidfTransformer()
54 | svd=TruncatedSVD(n_components=300, random_state=42)
55 | kf = KFold(len(X_train), n_folds=10)
56 |
57 |
58 | #knn
59 | clf=KNeighborsClassifier(n_neighbors=7,n_jobs=-1) #best exper for KNN
60 | pipeline = Pipeline([
61 | ('vect', vectorizer),
62 | ('tfidf', transformer),
63 | ('svd',svd),
64 | ('clf', clf)
65 | ])
66 |
67 | stats1 = compute_and_print()
68 |
69 |
70 |
71 | #randomforest
72 | clf=RandomForestClassifier(n_estimators=50,n_jobs=-1)
73 | pipeline = Pipeline([
74 | ('vect', vectorizer),
75 | ('tfidf', transformer),
76 | ('svd',svd),
77 | ('clf', clf)
78 | ])
79 |
80 | stats2 = compute_and_print()
81 |
82 |
83 |
84 | #logistic regression
85 | clf=LogisticRegression()
86 | pipeline = Pipeline([
87 | ('vect', vectorizer),
88 | ('tfidf', transformer),
89 | ('svd',svd),
90 | ('clf', clf)
91 | ])
92 |
93 |
94 | stats3 = compute_and_print()
95 |
96 | csv_out = open('EvaluationsMetricAccuracy', 'wb')
97 | clwriter = csv.writer(csv_out)
98 |
99 | for i in range(1,11):
100 | stats.append('Fold'+str(i) )
101 |
102 | fieldnames = ['Accuracy','KNN','RandomForests','LogisticRegression']
103 | rows = zip(stats, stats1, stats2,stats3)
104 | clwriter.writerow(fieldnames)
105 | clwriter.writerows(rows)
106 | csv_out.close()
107 |
--------------------------------------------------------------------------------
/datacleaning.py:
--------------------------------------------------------------------------------
1 | import os
2 | import random
3 |
4 | import pandas as pd
5 |
6 | from auxiliaryfunctions import *
7 |
8 | df = pd.read_csv('train_set.csv')
9 | df = df[pd.notnull(df['journeyPatternId'])] # deletes null values from dataset
10 |
11 | pd.set_option('display.max_rows', 1000000000)
12 |
13 | df['route'] = df['vehicleID'].map(str) + df['timestamp'].map(str)
14 | df = df.sort_values(by=['route'])
15 |
16 | df = df.reset_index(drop=True) # re index elements of df
17 |
18 | print("ready for cleaning.(completed sorting and creation of route)")
19 |
20 | df['timestamp_longitude_latitude'] = df[['timestamp', 'longitude', 'latitude']].values.tolist()
21 |
22 | df_2 = pd.DataFrame(columns=['TripId', 'JourneyPatternId', 'timestamp_longitude_latitude'])
23 |
24 | TripId_LOCS = []
25 |
26 | count = 0
27 |
28 | for index, row in df.iterrows():
29 |
30 | TripId_LOCS.append(df['timestamp_longitude_latitude'][index])
31 |
32 | if (index + 1) == df.shape[0]: # 1484821
33 | break
34 |
35 | if df['journeyPatternId'][index] != df['journeyPatternId'][index + 1]:
36 | a = TripId_LOCS
37 | df_2 = df_2.append(
38 | {'TripId': count, 'JourneyPatternId': df['journeyPatternId'][index], 'timestamp_longitude_latitude': a},
39 | ignore_index=True)
40 | count = count + 1
41 | TripId_LOCS = [] # make the list empty
42 | # print count
43 |
44 | df_2.to_pickle('TripId.df')
45 |
46 | # Data cleaning segment
47 |
48 |
49 | df3 = pd.read_pickle('./TripId.df')
50 | init_counter = len(df3.index)
51 | print('initially we had ' + str(init_counter) + ' trajectories')
52 | df_final = pd.DataFrame(
53 | columns=['TripId', 'JourneyPatternId', 'timestamp_longitude_latitude', 'total_distance', 'max_distance'])
54 |
55 | totaldrop = 0
56 | maxdrop = 0
57 | for index, row in df3.iterrows():
58 | td = compute_distances(df3['timestamp_longitude_latitude'][index]) # for each traj compute whole havershine in kms.
59 | if (td[0] <= 2): # total distance smaller than 2kms
60 | totaldrop = totaldrop + 1
61 | continue
62 | if (td[1] >= 2): # max distance bigger than 2kms
63 | maxdrop = maxdrop + 1
64 | continue
65 | else: # write info in new_final_cleaned dataframe
66 | df_final = df_final.append({'TripId': df3['TripId'][index], 'JourneyPatternId': df3['JourneyPatternId'][index],
67 | 'timestamp_longitude_latitude': df3['timestamp_longitude_latitude'][index],
68 | 'total_distance': td[0], 'max_distance': td[1]}, ignore_index=True)
69 |
70 | final_counter = len(df_final.index)
71 | print('we dropped ' + str(totaldrop) + ' trajectories from totaldistance.')
72 | print('we dropped ' + str(maxdrop) + ' trajectories from maxdistance.')
73 | print('finally,we have ' + str(final_counter) + ' trajectories')
74 | df_final.to_csv('final_cleaned.csv')
75 | df_final.to_pickle('final_cleaned.df')
76 |
77 | # Random Plotting Segment
78 |
79 | df_gm = pd.read_pickle('./final_cleaned.df')
80 |
81 | first_traj = df_gm['timestamp_longitude_latitude'].iloc[0]
82 |
83 | # randomly choose 5 trajectories
84 | r5 = random.sample(range(0, len(df_gm)), 5)
85 | i = 1
86 | # create output directory
87 | os.mkdir("Random_Images")
88 | for elem in r5:
89 | print
90 | "i chose traj : " + df_gm["JourneyPatternId"].iloc[elem]
91 | traj = df_gm['timestamp_longitude_latitude'].iloc[elem]
92 | plot_traj(traj, "./Random_Images/RandomImage" + str(i))
93 | i = i + 1
94 |
--------------------------------------------------------------------------------
/down_left_point.py:
--------------------------------------------------------------------------------
1 | import pandas as pd
2 |
3 | df = pd.read_pickle('final_cleaned.df')
4 | df_2 = pd.DataFrame(columns=['lon', 'the', 'timestamp_longitude_latitude'])
5 | df_3 = pd.DataFrame(columns=['lat', 'the', 'timestamp_longitude_latitude'])
6 |
7 |
8 | the_lst_lon = []
9 | the_lst_lat = []
10 |
11 | for index, row in df.iterrows():
12 | lst = df['timestamp_longitude_latitude'].iloc[index]
13 | min_lon = lst[0][1]
14 | min_lat = lst[0][2]
15 | the_lon = str(lst[0][1]) + ',' + str(lst[0][2])
16 | the_lat = str(lst[0][1]) + ',' + str(lst[0][2])
17 | for i in range(len(lst)):
18 | temp_lon = lst[i][1]
19 | temp_lat = lst[i][2]
20 | if temp_lon < min_lon:
21 | min_lon = temp_lon
22 | the_lon = str(lst[i][1]) + ',' + str(lst[i][2]) # the leftest diadromi point
23 | the_lst_lon = lst
24 | if temp_lat < min_lat:
25 | min_lat = temp_lat
26 | the_lat = str(lst[i][1]) + ',' + str(lst[i][2])
27 | the_lst_lat = lst
28 |
29 | print("found min lon and lat of traj")
30 | df_2 = df_2.append({'lon': str(min_lon)}, ignore_index=True)
31 | df_3 = df_3.append({'lat': str(min_lat)}, ignore_index=True)
32 | print("ready to sort")
33 | df_2 = df_2.sort_values(by=['lon'], ascending=False)
34 | df_3 = df_3.sort_values(by=['lat'])
35 |
36 | downleft_lon = df_2['lon'].iloc[0]
37 | downleft_lat = df_3['lat'].iloc[0]
38 |
39 | print(downleft_lon)
40 | print(downleft_lat)
41 |
--------------------------------------------------------------------------------
/fast_dtw_neigbors.py:
--------------------------------------------------------------------------------
1 | import csv
2 | import os
3 | import re
4 |
5 | import numpy as np
6 | import pandas as pd
7 | from fastdtw import fastdtw
8 |
9 | from auxiliaryfunctions import *
10 |
11 | df = pd.read_pickle('./final_cleaned.df')
12 | # l = df['timestamp_longitude_latitude'].iloc[0]
13 |
14 | with open('./test_set_a1.csv', 'r') as f:
15 | reader = csv.reader(f)
16 | data = (list(rec) for rec in csv.reader(f, delimiter=','))
17 | i = 0
18 | count = 0
19 | trajectories_read = [] # list with all trajectories read
20 | for row in data:
21 | if (i != 0):
22 | tmp_list = [] # to read triples
23 | trajectory = [] # here will be the final trajectory
24 | j = 0
25 | while (j != len(row)):
26 | tmp_list = [float(re.sub('[[]', '', row[j])), float(row[j + 1]), float(re.sub('[]]', '', row[j + 2]))]
27 | j = j + 3
28 | trajectory.append(tmp_list)
29 | tmp_list = []
30 | trajectories_read.append(trajectory)
31 | i = i + 1
32 |
33 | print("Dataset read successfully.")
34 |
35 | # create a directory for html images
36 | os.mkdir("DTWresults")
37 | j = 0
38 | # for each trajectory of test we want to find 5 NN using DTW + HAVERSHINE
39 | for traj in trajectories_read:
40 |
41 | # computeDTW similarity of given trajectory with all trajectories of the cleaned_dataset
42 |
43 | distances = []
44 | for elem in df['timestamp_longitude_latitude']:
45 | distance, path = fastdtw(elem, traj, dist=haversine_np)
46 | distances.append(distance)
47 | # find the 5 smaller using np arrays
48 | distancesnp = np.array(distances)
49 | sorted_ind = np.argsort(distancesnp)[:5]
50 | # for each we print the results
51 | k = 0
52 | for elem in sorted_ind:
53 | print_results(df, distancesnp, elem, "./DTWresults/trajectory" + str(j) + "neighbor" + str(k))
54 | k = k + 1
55 | j = j + 1
56 |
--------------------------------------------------------------------------------
/grid_points.py:
--------------------------------------------------------------------------------
1 | import pandas as pd
2 |
3 | from auxiliaryfunctions import *
4 |
5 | df = pd.read_pickle('final_cleaned.df')
6 | df_final = pd.DataFrame(columns=['TripId', 'Grids'])
7 |
8 | cell_size = 0.2 ########################## CELL SIZE ################
9 | zero_point = [0, -6.61505, 53.07045] ################ zero point
10 |
11 | for index, row in df.iterrows():
12 | grid = ''
13 | trajectory = df['timestamp_longitude_latitude'][index]
14 |
15 | last = ' ' # value that stores last element on the list
16 | for i in range(0, len(trajectory)):
17 |
18 | on_longitute_axis = []
19 | on_latitute_axis = []
20 |
21 | on_longitute_axis.append(zero_point[0])
22 | on_longitute_axis.append(trajectory[i][1])
23 | on_longitute_axis.append(zero_point[2])
24 | dist_of_longitute_axis = haversine_np(on_longitute_axis, zero_point)
25 |
26 | grid_lon = int(dist_of_longitute_axis // cell_size)
27 |
28 | on_latitute_axis.append(zero_point[0])
29 | on_latitute_axis.append(zero_point[1])
30 | on_latitute_axis.append(trajectory[i][2])
31 | dist_of_latitute_axis = haversine_np(on_latitute_axis, zero_point)
32 |
33 | grid_lat = int(dist_of_latitute_axis // cell_size)
34 |
35 | current_cell = str(grid_lat) + ',' + str(grid_lon)
36 |
37 | if current_cell == last:
38 | continue
39 |
40 | grid = grid + 'C' + current_cell + ';' ######################## grid formation. Every time it stores grid value of a point
41 |
42 | last = current_cell
43 |
44 | df_final = df_final.append({'TripId': df['TripId'][index], 'Grids': grid}, ignore_index=True)
45 |
46 | df_final.to_csv('grids.csv')
47 |
--------------------------------------------------------------------------------
/lcss_neighbors.py:
--------------------------------------------------------------------------------
1 | import csv
2 | import os
3 | import re
4 |
5 | import numpy as np
6 | import pandas as pd
7 | import time
8 |
9 | from auxiliaryfunctions import *
10 |
11 | df = pd.read_pickle('./final_cleaned.df')
12 |
13 | with open('test_set_a2.csv', 'r') as f:
14 | reader = csv.reader(f)
15 | data = (list(rec) for rec in csv.reader(f, delimiter=','))
16 | i = 0
17 | count = 0
18 | trajectories_read = [] # list with all trajectories read
19 | for row in data:
20 | if (i != 0):
21 | tmp_list = [] # to read triples
22 | trajectory = [] # here will be the final trajectory
23 | j = 0
24 | while (j != len(row)):
25 | tmp_list = [float(re.sub('[[]', '', row[j])), float(row[j + 1]), float(re.sub('[]]', '', row[j + 2]))]
26 | j = j + 3
27 | trajectory.append(tmp_list)
28 | tmp_list = []
29 | trajectories_read.append(trajectory)
30 | i = i + 1
31 |
32 | print("Dataset read successfully.")
33 |
34 | os.mkdir("LCSSresults")
35 | k = 0
36 |
37 | for traj in trajectories_read:
38 | start_time = time.time()
39 | k = k + 1
40 | matching_points = lcss_trigger(traj, df, 1, 0)
41 | distancesnp = np.array(matching_points)
42 | sorted_ind = np.argsort(-distancesnp)
43 | m = 1
44 | for elem in sorted_ind[:5]: # for each of the trajectories with the most matching points do
45 | print("Nearest trajectory " + str(df['JourneyPatternId'].iloc[elem]) + " Matching points : %d." % distancesnp[
46 | elem])
47 | # we find again which are the common points for the top 5 traj neighbors, in order to be printed red
48 | common_points = lcss_trigger(traj, df, 2, elem)
49 |
50 | plot_traj_red(common_points, df['timestamp_longitude_latitude'].iloc[elem],
51 | "./LCSSresults/trajectory" + str(k) + "matchingpointsneighb: " + str(m))
52 | m = m + 1
53 |
54 | end_time = time.time()
55 | print("Took %.3f mins for traj %d to finish" % ((float)((end_time - start_time) / 60), k))
56 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | pandas==1.1.4
2 | numpy==1.19.4
3 | fastdtw==0.3.4
4 | gmplot==1.4.1
5 | scikit-learn==0.23.2
6 |
--------------------------------------------------------------------------------
/test_set_a1.csv:
--------------------------------------------------------------------------------
1 | Trajectory
2 | [[1353941705000000, -6.3195670000000002, 53.299281999999998], [1353941724000000, -6.3195670000000002, 53.299281999999998], [1353941744000000, -6.3195670000000002, 53.299281999999998], [1353941763000000, -6.3195670000000002, 53.299281999999998], [1353941783000000, -6.3195670000000002, 53.299281999999998], [1353941804000000, -6.3195670000000002, 53.299281999999998], [1353941822000000, -6.3195670000000002, 53.299281999999998], [1353941843000000, -6.3195670000000002, 53.299281999999998], [1353941865000000, -6.3195670000000002, 53.299281999999998], [1353941882000000, -6.3195670000000002, 53.299281999999998], [1353941904000000, -6.3193380000000001, 53.299149], [1353941923000000, -6.3200440000000002, 53.297637999999999], [1353941943000000, -6.3205089999999995, 53.297192000000003], [1353941964000000, -6.3219410000000007, 53.295684999999999], [1353941982000000, -6.3222899999999997, 53.295295999999993], [1353942004000000, -6.324605, 53.296145999999993], [1353942024000000, -6.3258859999999997, 53.298072999999995], [1353942044000000, -6.3251059999999999, 53.299422999999997], [1353942063000000, -6.3242349999999998, 53.300506999999996], [1353942083000000, -6.3232059999999999, 53.301651], [1353942104000000, -6.3220499999999999, 53.303566000000004], [1353942122000000, -6.3221290000000003, 53.304504000000001], [1353942145000000, -6.3213660000000003, 53.306170999999999], [1353942163000000, -6.3217780000000001, 53.307120999999995], [1353942184000000, -6.3209569999999999, 53.307941000000007], [1353942204000000, -6.3207370000000003, 53.309376], [1353942224000000, -6.320951, 53.309803000000002], [1353942243000000, -6.3213839999999992, 53.311089000000003], [1353942263000000, -6.3210850000000001, 53.312038000000001], [1353942284000000, -6.3202769999999999, 53.313193999999996], [1353942302000000, -6.3198850000000002, 53.313606000000007], [1353942325000000, -6.3197999999999999, 53.313679], [1353942343000000, -6.3178839999999994, 53.315075], [1353942362000000, -6.3172819999999996, 53.315472], [1353942384000000, -6.3172819999999996, 53.315472], [1353942402000000, -6.3172819999999996, 53.315472], [1353942423000000, -6.3170320000000002, 53.316009999999999], [1353942445000000, -6.3170320000000002, 53.316009999999999], [1353942462000000, -6.3170320000000002, 53.316009999999999], [1353942483000000, -6.3170320000000002, 53.316009999999999], [1353942509000000, -6.3170320000000002, 53.316009999999999], [1353942523000000, -6.3170320000000002, 53.316009999999999], [1353942545000000, -6.3170320000000002, 53.316009999999999], [1353942564000000, -6.3167919999999995, 53.316692000000003], [1353942584000000, -6.316573, 53.316956000000005], [1353942603000000, -6.3156499999999998, 53.317512999999998], [1353942623000000, -6.3152309999999998, 53.319293999999992], [1353942644000000, -6.3155410000000005, 53.319694999999996], [1353942662000000, -6.3158589999999997, 53.320087000000001], [1353942684000000, -6.3169839999999997, 53.320960999999997], [1353942702000000, -6.3169839999999997, 53.320960999999997], [1353942723000000, -6.3184129999999996, 53.321663000000001], [1353942745000000, -6.3192320000000004, 53.322178000000001], [1353942762000000, -6.319839, 53.322716], [1353942784000000, -6.3183870000000004, 53.323932999999997], [1353942802000000, -6.317736, 53.324528000000001], [1353942823000000, -6.317736, 53.324528000000001], [1353942843000000, -6.317736, 53.324528000000001], [1353942864000000, -6.317736, 53.324528000000001], [1353942886000000, -6.317736, 53.324528000000001], [1353942903000000, -6.317526, 53.324715000000005], [1353942923000000, -6.317526, 53.324715000000005], [1353942943000000, -6.317526, 53.324715000000005], [1353942962000000, -6.317526, 53.324715000000005], [1353942985000000, -6.317526, 53.324715000000005], [1353943002000000, -6.3162449999999994, 53.324897999999997], [1353943022000000, -6.3138370000000004, 53.325012000000001], [1353943046000000, -6.3131379999999995, 53.325081000000004], [1353943063000000, -6.3104529999999999, 53.325221999999997], [1353943084000000, -6.3090359999999999, 53.325274999999998], [1353943103000000, -6.3062559999999994, 53.325115000000004], [1353943123000000, -6.305415, 53.325062000000003], [1353943142000000, -6.3027190000000006, 53.324885999999999], [1353943162000000, -6.3010449999999993, 53.324879000000003], [1353943184000000, -6.3001300000000002, 53.324996999999996], [1353943203000000, -6.2986300000000002, 53.325340000000004], [1353943222000000, -6.2980660000000004, 53.325466000000006], [1353943244000000, -6.2959589999999999, 53.325905000000006], [1353943263000000, -6.2959589999999999, 53.325905000000006], [1353943283000000, -6.294581, 53.326163999999999], [1353943302000000, -6.2926539999999997, 53.326518999999998], [1353943322000000, -6.2908220000000004, 53.326843000000004], [1353943343000000, -6.2895190000000003, 53.327094999999993], [1353943363000000, -6.2878889999999998, 53.327515000000005], [1353943384000000, -6.2866629999999999, 53.328175000000002], [1353943404000000, -6.2847140000000001, 53.329376000000003], [1353943422000000, -6.28437, 53.329803000000005], [1353943443000000, -6.2842440000000002, 53.330100999999999], [1353943463000000, -6.2840930000000004, 53.330535999999995], [1353943484000000, -6.2840449999999999, 53.330668999999993], [1353943504000000, -6.2834240000000001, 53.331920999999994], [1353943525000000, -6.2824960000000001, 53.332923999999998], [1353943543000000, -6.28301, 53.333801000000001], [1353943582000000, -6.2807769999999996, 53.334437999999999], [1353943605000000, -6.2789989999999998, 53.334662999999999], [1353943623000000, -6.2793380000000001, 53.335979000000002], [1353943644000000, -6.2794759999999998, 53.336742000000001], [1353943664000000, -6.2789800000000007, 53.337283999999997], [1353943683000000, -6.2788900000000005, 53.337852000000005], [1353943703000000, -6.2792849999999998, 53.338413000000003], [1353943724000000, -6.2799110000000002, 53.339241000000001], [1353943742000000, -6.2785739999999999, 53.339820999999993], [1353943762000000, -6.2780260000000006, 53.339828000000004], [1353943783000000, -6.27562, 53.339606999999994], [1353943804000000, -6.2746219999999999, 53.339352000000005], [1353943824000000, -6.2734030000000001, 53.339115], [1353943841000000, -6.2725809999999997, 53.339424000000001], [1353943862000000, -6.2723559999999994, 53.340267000000004], [1353943884000000, -6.2723500000000003, 53.341827000000002], [1353943903000000, -6.2720080000000005, 53.342777000000005], [1353943923000000, -6.2703519999999999, 53.343254000000002], [1353943944000000, -6.2702150000000003, 53.343375999999999], [1353943962000000, -6.2687620000000006, 53.343856999999993], [1353943983000000, -6.2681319999999996, 53.343986999999998], [1353944003000000, -6.2677589999999999, 53.344058999999994], [1353944024000000, -6.2666300000000001, 53.344181000000006], [1353944044000000, -6.2660730000000004, 53.344200000000001], [1353944063000000, -6.2639889999999996, 53.344215000000005], [1353944083000000, -6.2628589999999997, 53.344260999999996], [1353944102000000, -6.2624379999999995, 53.344276000000001], [1353944122000000, -6.262378, 53.344280000000005], [1353944145000000, -6.261158, 53.344382999999993], [1353944163000000, -6.2590980000000007, 53.345069999999993], [1353944182000000, -6.2589579999999998, 53.345859999999995], [1353944204000000, -6.2589579999999998, 53.345859999999995]]
3 | [[1353924161000000, -6.2608670000000002, 53.352814000000002], [1353924184000000, -6.2608670000000002, 53.352814000000002], [1353924202000000, -6.2608670000000002, 53.352814000000002], [1353924242000000, -6.2608670000000002, 53.352814000000002], [1353924283000000, -6.2679849999999995, 53.354796999999998], [1353924304000000, -6.2684389999999999, 53.355258999999997], [1353924324000000, -6.2682609999999999, 53.357245999999996], [1353924343000000, -6.2697859999999999, 53.359093000000009], [1353924363000000, -6.2696990000000001, 53.359966], [1353924383000000, -6.2696709999999998, 53.360165000000002], [1353924402000000, -6.2696709999999998, 53.360165000000002], [1353924423000000, -6.270251, 53.360633999999997], [1353924443000000, -6.2714800000000004, 53.360718000000006], [1353924462000000, -6.2730559999999995, 53.360793999999991], [1353924482000000, -6.275544, 53.360806000000004], [1353924504000000, -6.2756350000000003, 53.360806000000004], [1353924522000000, -6.2764489999999995, 53.360813], [1353924543000000, -6.2784339999999998, 53.360881999999997], [1353924563000000, -6.2811839999999997, 53.360984999999999], [1353924582000000, -6.2823410000000006, 53.361027], [1353924602000000, -6.2829480000000002, 53.361053000000005], [1353924623000000, -6.2832980000000003, 53.361068999999993], [1353924643000000, -6.2831929999999998, 53.361561000000002], [1353924664000000, -6.283029, 53.362170999999996], [1353924682000000, -6.2826500000000003, 53.363506000000008], [1353924703000000, -6.2835489999999998, 53.363991000000006], [1353924721000000, -6.2874349999999994, 53.364716000000001], [1353924744000000, -6.2892239999999999, 53.365402000000003], [1353924762000000, -6.2912160000000004, 53.366463000000003], [1353924781000000, -6.2914810000000001, 53.366523999999998], [1353924804000000, -6.2914810000000001, 53.366523999999998], [1353924823000000, -6.2918880000000001, 53.366919999999993], [1353924844000000, -6.2916840000000001, 53.367249000000001], [1353924864000000, -6.2910349999999999, 53.368419999999993], [1353924903000000, -6.2957089999999996, 53.370231999999994], [1353924924000000, -6.299461, 53.370959999999997], [1353924942000000, -6.3011460000000001, 53.371265000000001], [1353924961000000, -6.3015040000000004, 53.371272999999995], [1353924984000000, -6.3044070000000003, 53.371268999999991], [1353925002000000, -6.3045359999999997, 53.370377000000005], [1353925025000000, -6.304443, 53.369926], [1353925043000000, -6.3041870000000007, 53.369082999999996], [1353925061000000, -6.3045260000000001, 53.368786], [1353925082000000, -6.3045260000000001, 53.368786], [1353925104000000, -6.3045339999999994, 53.368778000000006], [1353925123000000, -6.3058139999999998, 53.369328000000003], [1353925144000000, -6.3061020000000001, 53.370964000000001], [1353925164000000, -6.3061339999999992, 53.372486000000002], [1353925182000000, -6.307258, 53.373927999999999], [1353925203000000, -6.3086070000000003, 53.374831999999998], [1353925223000000, -6.3105019999999996, 53.376373000000001], [1353925242000000, -6.3127000000000004, 53.37574], [1353925262000000, -6.315607, 53.375720999999999], [1353925283000000, -6.3188139999999997, 53.375751000000001], [1353925301000000, -6.321561, 53.376018999999992], [1353925366000000, -6.321561, 53.376018999999992], [1353925383000000, -6.3277960000000002, 53.377231999999992], [1353925387000000, -6.3280669999999999, 53.377231999999992], [1353925405000000, -6.3308089999999995, 53.377219999999994], [1353925426000000, -6.3314879999999993, 53.377532999999993], [1353925465000000, -6.3314879999999993, 53.377532999999993], [1353925485000000, -6.3314879999999993, 53.377532999999993], [1353925504000000, -6.3317500000000004, 53.377418999999996]]
4 | [[1353939307000000, -6.3667169999999995, 53.340182999999996], [1353939329000000, -6.3667169999999995, 53.340182999999996], [1353939368000000, -6.3667169999999995, 53.340182999999996], [1353939388000000, -6.3667169999999995, 53.340182999999996], [1353939407000000, -6.3667169999999995, 53.340182999999996], [1353939428000000, -6.3667169999999995, 53.340182999999996], [1353939448000000, -6.3667169999999995, 53.340182999999996], [1353939467000000, -6.3667169999999995, 53.340182999999996], [1353939487000000, -6.3667169999999995, 53.340182999999996], [1353939506000000, -6.3667169999999995, 53.340182999999996], [1353939526000000, -6.3667169999999995, 53.340182999999996], [1353939546000000, -6.3667169999999995, 53.340182999999996], [1353939567000000, -6.3667169999999995, 53.340182999999996], [1353939587000000, -6.3667169999999995, 53.340182999999996], [1353939608000000, -6.3687649999999998, 53.340598999999997], [1353939626000000, -6.3676870000000001, 53.340401], [1353939649000000, -6.372134, 53.340297999999997], [1353939667000000, -6.3733370000000003, 53.338885999999995], [1353939687000000, -6.3744319999999997, 53.337718999999993], [1353939706000000, -6.3723470000000004, 53.337128], [1353939726000000, -6.3703609999999999, 53.336853000000005], [1353939747000000, -6.3686099999999994, 53.336525000000002], [1353939769000000, -6.365964, 53.335818999999994], [1353939786000000, -6.3630209999999998, 53.335567000000005], [1353939806000000, -6.3605700000000001, 53.335831000000006], [1353939827000000, -6.3605489999999998, 53.337058999999996], [1353939847000000, -6.361224, 53.338881999999998], [1353939868000000, -6.3617059999999999, 53.340434999999999], [1353939886000000, -6.3618300000000003, 53.342178000000004], [1353939907000000, -6.3615519999999997, 53.342865000000003], [1353939929000000, -6.361415, 53.342854000000003], [1353939946000000, -6.3598520000000001, 53.342716000000003], [1353939968000000, -6.3587879999999997, 53.342686], [1353939987000000, -6.3560379999999999, 53.342406999999994], [1353940007000000, -6.3532820000000001, 53.342193999999992], [1353940026000000, -6.3531930000000001, 53.342357999999997], [1353940046000000, -6.3531930000000001, 53.342357999999997], [1353940067000000, -6.3545780000000001, 53.342461], [1353940087000000, -6.3536019999999995, 53.342216000000001], [1353940108000000, -6.3518379999999999, 53.342143999999998], [1353940128000000, -6.3506879999999999, 53.342185999999998], [1353940146000000, -6.3487519999999993, 53.342006999999995], [1353940167000000, -6.3484860000000003, 53.341258999999994], [1353940187000000, -6.3481489999999994, 53.339332999999996], [1353940208000000, -6.3476460000000001, 53.338093000000008], [1353940226000000, -6.3465790000000002, 53.337794999999993], [1353940249000000, -6.3465020000000001, 53.338341], [1353940267000000, -6.3463190000000003, 53.339024000000002], [1353940286000000, -6.3453339999999994, 53.339213999999998], [1353940327000000, -6.3414230000000007, 53.339995999999999], [1353940347000000, -6.3380999999999998, 53.340664000000004], [1353940367000000, -6.3370169999999995, 53.340831999999992], [1353940388000000, -6.3357869999999998, 53.341064000000003], [1353940406000000, -6.3332639999999998, 53.341586999999997], [1353940429000000, -6.3328089999999992, 53.341805000000008], [1353940447000000, -6.3313069999999998, 53.341843000000004], [1353940467000000, -6.3298199999999998, 53.341594999999998], [1353940486000000, -6.3291529999999998, 53.341763], [1353940507000000, -6.3291529999999998, 53.341763], [1353940527000000, -6.3290850000000001, 53.341923000000001], [1353940548000000, -6.3276570000000003, 53.342174999999997], [1353940566000000, -6.3260199999999998, 53.342120999999999], [1353940589000000, -6.3233090000000001, 53.341460999999995], [1353940608000000, -6.3210110000000004, 53.341537000000002], [1353940628000000, -6.3200959999999995, 53.341582999999993], [1353940647000000, -6.319585, 53.341606000000006], [1353940667000000, -6.3170910000000005, 53.341805000000008], [1353940687000000, -6.3167410000000004, 53.342068000000005], [1353940708000000, -6.3168239999999996, 53.342686], [1353940727000000, -6.3140019999999994, 53.343196999999996], [1353940749000000, -6.3092040000000003, 53.343581999999998], [1353940765000000, -6.3058420000000002, 53.343997999999999], [1353940787000000, -6.3016480000000001, 53.345183999999996], [1353940807000000, -6.2978059999999996, 53.345721999999995], [1353940826000000, -6.294327, 53.346012000000002], [1353940848000000, -6.2926970000000004, 53.346142000000007], [1353940867000000, -6.2926380000000002, 53.346145999999997], [1353940887000000, -6.2914050000000001, 53.346545999999996], [1353940908000000, -6.2913519999999998, 53.346626000000001], [1353940926000000, -6.2913519999999998, 53.346626000000001], [1353940947000000, -6.2913519999999998, 53.346626000000001], [1353940968000000, -6.2913519999999998, 53.346626000000001], [1353940988000000, -6.2908850000000003, 53.347262999999998], [1353941007000000, -6.2885330000000002, 53.347168000000003], [1353941027000000, -6.2850809999999999, 53.347023], [1353941048000000, -6.2819099999999999, 53.346808999999993], [1353941066000000, -6.2787959999999998, 53.346325], [1353941087000000, -6.276262, 53.345879000000004], [1353941109000000, -6.276262, 53.345879000000004], [1353941125000000, -6.276262, 53.345879000000004], [1353941148000000, -6.2760239999999996, 53.345843999999992], [1353941166000000, -6.272424, 53.345539000000002], [1353941187000000, -6.2706179999999998, 53.345706999999997], [1353941207000000, -6.2698859999999996, 53.345797999999995], [1353941226000000, -6.2693289999999999, 53.345874999999999], [1353941246000000, -6.2688600000000001, 53.345936000000002], [1353941269000000, -6.2677830000000005, 53.345764000000003], [1353941287000000, -6.2677800000000001, 53.345756999999992], [1353941308000000, -6.2675769999999993, 53.345149999999997], [1353941326000000, -6.2674010000000004, 53.344668999999996], [1353941347000000, -6.2673809999999994, 53.344616000000002], [1353941367000000, -6.2663500000000001, 53.344195999999997], [1353941388000000, -6.2647919999999999, 53.344200000000001], [1353941406000000, -6.2628589999999997, 53.344260999999996], [1353941429000000, -6.262562, 53.344273000000001], [1353941447000000, -6.2618199999999993, 53.344868000000005], [1353941468000000, -6.2618070000000001, 53.345943000000005], [1353941486000000, -6.261196, 53.346127000000003], [1353941527000000, -6.261196, 53.346127000000003], [1353941550000000, -6.261196, 53.346127000000003], [1353941568000000, -6.261196, 53.346127000000003], [1353941601000000, -6.2601500000000003, 53.346648999999999], [1353941607000000, -6.2601830000000005, 53.346699000000001], [1353941630000000, -6.2601830000000005, 53.346699000000001], [1353941646000000, -6.2601830000000005, 53.346699000000001], [1353941662000000, -6.2601830000000005, 53.346699000000001], [1353941667000000, -6.260167, 53.346699000000001], [1353941687000000, -6.260167, 53.346699000000001], [1353941707000000, -6.2601830000000005, 53.346699000000001], [1353941722000000, -6.2601830000000005, 53.346699000000001], [1353941730000000, -6.2601830000000005, 53.346683999999996], [1353941746000000, -6.2601830000000005, 53.346683999999996], [1353941767000000, -6.2601830000000005, 53.346699000000001]]
5 | [[1353916488000000, -6.2620120000000004, 53.353268000000007], [1353916527000000, -6.2620120000000004, 53.353268000000007], [1353916556000000, -6.2606720000000005, 53.351185000000001], [1353916587000000, -6.2605649999999997, 53.350937000000002], [1353916608000000, -6.2620120000000004, 53.353268000000007], [1353916629000000, -6.2599879999999999, 53.349651000000001], [1353916647000000, -6.259576, 53.348713000000004], [1353916668000000, -6.259525, 53.348591000000006], [1353916688000000, -6.2591339999999995, 53.347614], [1353916709000000, -6.2579609999999999, 53.346313000000002], [1353916727000000, -6.2571620000000001, 53.345917000000007], [1353916748000000, -6.2571620000000001, 53.345917000000007], [1353916768000000, -6.2562169999999995, 53.345905000000002], [1353916787000000, -6.2561400000000003, 53.345969999999994], [1353916807000000, -6.2561400000000003, 53.345969999999994], [1353916827000000, -6.2556000000000003, 53.345943000000005], [1353916850000000, -6.2556000000000003, 53.345943000000005], [1353916866000000, -6.2556000000000003, 53.345943000000005], [1353916887000000, -6.253952, 53.345859999999995], [1353916928000000, -6.2508189999999999, 53.345698999999996], [1353916946000000, -6.2499199999999995, 53.345654000000003], [1353916967000000, -6.247611, 53.345104000000006], [1353916990000000, -6.246486, 53.343699999999998], [1353917008000000, -6.2453269999999996, 53.343327000000002], [1353917026000000, -6.2450269999999994, 53.343266], [1353917047000000, -6.2450269999999994, 53.343266], [1353917068000000, -6.2447559999999998, 53.343207999999997], [1353917088000000, -6.2424370000000007, 53.342895999999996], [1353917107000000, -6.2421410000000002, 53.342860999999999], [1353917129000000, -6.2421410000000002, 53.342860999999999], [1353917146000000, -6.2405689999999998, 53.342669999999998], [1353917166000000, -6.2396229999999999, 53.342544999999994], [1353917187000000, -6.2396229999999999, 53.342544999999994], [1353917210000000, -6.2396080000000005, 53.342544999999994], [1353917228000000, -6.2393710000000002, 53.342514000000001], [1353917246000000, -6.2393710000000002, 53.342514000000001], [1353917267000000, -6.2393559999999999, 53.342509999999997], [1353917290000000, -6.2383160000000002, 53.342383999999996], [1353917308000000, -6.2367040000000005, 53.342216000000001], [1353917329000000, -6.2363960000000001, 53.342167000000003], [1353917349000000, -6.2363960000000001, 53.342167000000003], [1353917368000000, -6.2363960000000001, 53.342167000000003], [1353917386000000, -6.2333600000000002, 53.341758999999996], [1353917407000000, -6.2333600000000002, 53.341758999999996], [1353917428000000, -6.2293000000000003, 53.341636999999999], [1353917446000000, -6.2271289999999997, 53.341831000000006], [1353917467000000, -6.2267220000000005, 53.341904000000007], [1353917487000000, -6.2242360000000003, 53.340302000000001], [1353917510000000, -6.2232769999999995, 53.339348000000001], [1353917528000000, -6.2230699999999999, 53.339077000000003], [1353917547000000, -6.2227480000000002, 53.338271999999996], [1353917568000000, -6.2224760000000003, 53.337692000000004], [1353917590000000, -6.2223800000000002, 53.337315000000004], [1353917607000000, -6.2219709999999999, 53.336043999999994], [1353917627000000, -6.2201979999999999, 53.335655000000003], [1353917648000000, -6.2197190000000004, 53.335415000000005], [1353917670000000, -6.2187000000000001, 53.334717000000005], [1353917687000000, -6.2175820000000002, 53.333942000000008], [1353917708000000, -6.2170230000000002, 53.333556999999992], [1353917727000000, -6.2166030000000001, 53.333256000000006], [1353917747000000, -6.2164160000000006, 53.333110999999995], [1353917789000000, -6.2154120000000006, 53.332484999999998], [1353917827000000, -6.2142860000000004, 53.333518999999995], [1353917846000000, -6.2142400000000002, 53.333401000000002], [1353917869000000, -6.2142370000000007, 53.333393000000008], [1353917890000000, -6.2136059999999995, 53.333477000000002], [1353917906000000, -6.21143, 53.333286000000001], [1353917927000000, -6.2106330000000005, 53.332413000000003], [1353917947000000, -6.2102360000000001, 53.331802000000003], [1353917966000000, -6.2089879999999997, 53.329932999999997], [1353917986000000, -6.2087260000000004, 53.327998999999998], [1353918007000000, -6.2082430000000004, 53.326939000000003], [1353918027000000, -6.2073460000000003, 53.325611000000002], [1353918046000000, -6.207198, 53.325340000000004], [1353918066000000, -6.2072209999999997, 53.325127000000002], [1353918087000000, -6.2072209999999997, 53.325127000000002], [1353918108000000, -6.2079110000000002, 53.324978000000002], [1353918147000000, -6.2079110000000002, 53.324978000000002], [1353918176000000, -6.2106330000000005, 53.324467000000006]]
6 | [[1353923529000000, -6.2571330000000005, 53.348948999999998], [1353923549000000, -6.2572720000000004, 53.348789000000004], [1353923568000000, -6.256589, 53.348445999999996], [1353923588000000, -6.2561279999999995, 53.348514999999999], [1353923611000000, -6.2546850000000003, 53.348938000000004], [1353923629000000, -6.2521660000000008, 53.349383999999993], [1353923650000000, -6.2520910000000001, 53.349383999999993], [1353923670000000, -6.2507510000000002, 53.350276999999998], [1353923689000000, -6.2506129999999995, 53.350493999999998], [1353923709000000, -6.2503769999999994, 53.350868000000006], [1353923731000000, -6.2503769999999994, 53.350868000000006], [1353923749000000, -6.2503769999999994, 53.350868000000006], [1353923770000000, -6.2499060000000002, 53.351612000000003], [1353923788000000, -6.2489429999999997, 53.352649999999997], [1353923811000000, -6.248075, 53.353423999999997], [1353923827000000, -6.247725, 53.353747999999996], [1353923848000000, -6.2469869999999998, 53.354434999999995], [1353923871000000, -6.2460050000000003, 53.355286], [1353923889000000, -6.2456620000000003, 53.355679000000002], [1353923908000000, -6.2442010000000003, 53.356582999999993], [1353923931000000, -6.242362, 53.357776999999999], [1353923950000000, -6.2402959999999998, 53.359406000000007], [1353923968000000, -6.2394530000000001, 53.360194999999997], [1353923988000000, -6.239058, 53.360580000000006], [1353924011000000, -6.237241, 53.362082999999998], [1353924029000000, -6.2368829999999997, 53.362395999999997], [1353924048000000, -6.236332, 53.362854000000006], [1353924069000000, -6.2346810000000001, 53.363365000000002], [1353924089000000, -6.2317929999999997, 53.364113000000003], [1353924110000000, -6.231338, 53.364212000000002], [1353924130000000, -6.2285980000000007, 53.364216000000006], [1353924149000000, -6.2268439999999998, 53.364024999999998], [1353924169000000, -6.2247240000000001, 53.363712], [1353924190000000, -6.2211679999999996, 53.363093999999997], [1353924209000000, -6.2176800000000005, 53.362411000000002], [1353924227000000, -6.2165230000000005, 53.362006999999998], [1353924250000000, -6.214798, 53.361317000000007], [1353924269000000, -6.2116660000000001, 53.360469999999992], [1353924289000000, -6.2102820000000003, 53.360370999999994], [1353924310000000, -6.2102820000000003, 53.360370999999994], [1353924328000000, -6.2087769999999995, 53.360275000000001], [1353924349000000, -6.2070099999999995, 53.360232999999994], [1353924369000000, -6.2029800000000002, 53.360236999999998], [1353924390000000, -6.1989410000000005, 53.359611999999998], [1353924408000000, -6.1968319999999997, 53.359226], [1353924429000000, -6.1963239999999997, 53.359055000000005], [1353924449000000, -6.19421, 53.358276000000004], [1353924468000000, -6.1934529999999999, 53.358204000000001], [1353924491000000, -6.1928160000000005, 53.358173000000001], [1353924510000000, -6.1928160000000005, 53.358173000000001], [1353924529000000, -6.186267, 53.359665], [1353924549000000, -6.186267, 53.359665], [1353924570000000, -6.1821800000000007, 53.360911999999999], [1353924588000000, -6.1812069999999997, 53.361305000000002], [1353924608000000, -6.1790599999999998, 53.362423], [1353924631000000, -6.1789239999999994, 53.362518000000009], [1353924649000000, -6.1764720000000004, 53.364281000000005], [1353924687000000, -6.1764720000000004, 53.364281000000005], [1353924707000000, -6.1728649999999998, 53.367160999999996], [1353924728000000, -6.1753749999999998, 53.368118000000003], [1353924746000000, -6.1791330000000002, 53.369236000000001], [1353924804000000, -6.1830790000000002, 53.366572999999995], [1353924823000000, -6.1852220000000004, 53.366107999999997], [1353924844000000, -6.1877519999999997, 53.366374999999998], [1353924864000000, -6.1879439999999999, 53.364993999999996], [1353924882000000, -6.1881050000000002, 53.363838000000001], [1353924903000000, -6.1897669999999998, 53.363608999999997], [1353924924000000, -6.1921410000000003, 53.363838000000001], [1353924946000000, -6.1938149999999998, 53.363964000000003], [1353924963000000, -6.1948230000000004, 53.364014000000005], [1353924984000000, -6.1952829999999999, 53.364745999999997], [1353925002000000, -6.1955599999999995, 53.365929000000001], [1353925025000000, -6.1991559999999994, 53.366261000000002], [1353925043000000, -6.2023489999999999, 53.366595999999994], [1353925082000000, -6.2051179999999997, 53.364722999999998], [1353925123000000, -6.2051179999999997, 53.364722999999998], [1353925144000000, -6.2054169999999997, 53.363300000000002]]
7 |
--------------------------------------------------------------------------------
/test_set_a2.csv:
--------------------------------------------------------------------------------
1 | Trajectory
2 | [[1353940335000000, -6.379759, 53.418506999999998], [1353940339000000, -6.3784589999999994, 53.419052000000001], [1353940378000000, -6.3839639999999997, 53.419311999999998], [1353940394000000, -6.3847319999999996, 53.420020999999998], [1353940414000000, -6.3847399999999999, 53.420254000000007], [1353940437000000, -6.3850050000000005, 53.420749999999998], [1353940476000000, -6.3881649999999999, 53.421374999999998], [1353940494000000, -6.3882070000000004, 53.421275999999999], [1353940515000000, -6.3889959999999997, 53.421730000000004], [1353940535000000, -6.3909640000000003, 53.421996999999998], [1353940556000000, -6.3913349999999998, 53.421753000000002], [1353940574000000, -6.3927629999999995, 53.421013000000002], [1353940597000000, -6.3928900000000004, 53.419830000000005], [1353940614000000, -6.3917859999999997, 53.419761999999999], [1353940634000000, -6.3901180000000002, 53.419772999999999], [1353940655000000, -6.3888230000000004, 53.419024999999998], [1353940675000000, -6.3867019999999997, 53.418030000000002], [1353940696000000, -6.3862760000000005, 53.417743999999992], [1353940714000000, -6.3856960000000003, 53.416633999999995], [1353940735000000, -6.3842290000000004, 53.416229000000001], [1353940757000000, -6.3849559999999999, 53.415348000000002], [1353940776000000, -6.3864999999999998, 53.414168999999994], [1353940795000000, -6.3857099999999996, 53.413181000000009], [1353940817000000, -6.3818900000000003, 53.412430000000008], [1353940836000000, -6.3771399999999998, 53.411217000000008], [1353940857000000, -6.3734199999999994, 53.410099000000002], [1353940875000000, -6.3709410000000002, 53.409293999999996], [1353940895000000, -6.3703080000000005, 53.409031000000006], [1353940914000000, -6.3689239999999998, 53.408847999999999], [1353940935000000, -6.3686449999999999, 53.410022999999995], [1353940955000000, -6.3682109999999996, 53.410796999999995], [1353940976000000, -6.3682109999999996, 53.410796999999995], [1353940996000000, -6.3679589999999999, 53.411041000000004], [1353941015000000, -6.3671809999999995, 53.411597999999998], [1353941035000000, -6.3658239999999999, 53.412601000000002], [1353941056000000, -6.364274, 53.413997999999999], [1353941074000000, -6.3634309999999994, 53.414237999999997], [1353941095000000, -6.3620049999999999, 53.413447999999995], [1353941117000000, -6.3608919999999998, 53.412727000000004], [1353941136000000, -6.3596349999999999, 53.411307999999998], [1353941156000000, -6.3586580000000001, 53.409603000000004], [1353941177000000, -6.3578749999999999, 53.408237], [1353941195000000, -6.3578749999999999, 53.408237], [1353941215000000, -6.3578749999999999, 53.408237], [1353941238000000, -6.3578749999999999, 53.408237], [1353941254000000, -6.3579829999999999, 53.407890000000002], [1353941277000000, -6.3557249999999996, 53.406704000000005], [1353941295000000, -6.3562129999999994, 53.406143000000007], [1353941314000000, -6.3574109999999999, 53.404423000000001], [1353941334000000, -6.3567140000000002, 53.403553000000002], [1353941355000000, -6.3552569999999999, 53.401908999999996], [1353941376000000, -6.3530800000000003, 53.399967000000004], [1353941396000000, -6.350422, 53.398536999999997], [1353941415000000, -6.3462819999999995, 53.397769999999994], [1353941437000000, -6.3420779999999999, 53.397453000000006], [1353941455000000, -6.3392349999999995, 53.397483999999999], [1353941474000000, -6.3392349999999995, 53.397483999999999], [1353941494000000, -6.3329050000000002, 53.398239000000004], [1353941515000000, -6.331461, 53.397193999999992], [1353941535000000, -6.3291649999999997, 53.395724999999999], [1353941558000000, -6.3259780000000001, 53.394753000000001], [1353941576000000, -6.3233489999999994, 53.393447999999999], [1353941595000000, -6.3210430000000004, 53.392277], [1353941615000000, -6.3210430000000004, 53.392277], [1353941636000000, -6.3198429999999997, 53.391815000000001], [1353941654000000, -6.319509, 53.390785000000001], [1353941675000000, -6.3173650000000006, 53.390273999999998], [1353941695000000, -6.315105, 53.389907999999998], [1353941716000000, -6.3143640000000003, 53.389659999999999], [1353941736000000, -6.3129870000000006, 53.389336], [1353941755000000, -6.3129870000000006, 53.389336], [1353941775000000, -6.3124480000000007, 53.389293999999992], [1353941798000000, -6.3118860000000003, 53.390056999999992], [1353941814000000, -6.3109459999999995, 53.390030000000003], [1353941835000000, -6.3100680000000002, 53.389949999999999], [1353941857000000, -6.308141, 53.389854000000007], [1353941874000000, -6.3067359999999999, 53.389854000000007], [1353941896000000, -6.3045419999999996, 53.389846999999996], [1353941915000000, -6.3015870000000005, 53.389927], [1353941935000000, -6.3002949999999993, 53.390053000000002]]
3 | [[1353942004000000, -6.2982100000000001, 53.388390000000001], [1353942024000000, -6.2982100000000001, 53.388390000000001], [1353942044000000, -6.2977509999999999, 53.387706999999992], [1353942065000000, -6.297193, 53.387135000000001], [1353942083000000, -6.2972080000000004, 53.387118999999991], [1353942104000000, -6.2972080000000004, 53.387118999999991], [1353942126000000, -6.2972080000000004, 53.387118999999991], [1353942145000000, -6.2975309999999993, 53.386906000000003], [1353942163000000, -6.295585, 53.385399], [1353942206000000, -6.2934060000000001, 53.383667000000003], [1353942224000000, -6.2900679999999998, 53.381370999999994], [1353942245000000, -6.2880370000000001, 53.379573999999998], [1353942265000000, -6.2875300000000003, 53.37809], [1353942286000000, -6.287528, 53.378036000000002], [1353942304000000, -6.2874999999999996, 53.377685999999997], [1353942325000000, -6.2863600000000002, 53.375851000000004], [1353942347000000, -6.2850609999999998, 53.373824999999997], [1353942364000000, -6.2827989999999998, 53.372406000000005], [1353942384000000, -6.2820609999999997, 53.372107999999997], [1353942406000000, -6.2795639999999997, 53.370482999999993], [1353942425000000, -6.2765139999999997, 53.369246999999994], [1353942445000000, -6.2737300000000005, 53.368133999999998], [1353942464000000, -6.2732539999999997, 53.367919999999998], [1353942485000000, -6.2727430000000002, 53.367595999999999], [1353942507000000, -6.2709679999999999, 53.367134], [1353942525000000, -6.2713019999999995, 53.366195999999995], [1353942545000000, -6.2716709999999996, 53.365364], [1353942564000000, -6.271706, 53.365147], [1353942584000000, -6.271738, 53.364947999999998], [1353942607000000, -6.271738, 53.364947999999998], [1353942625000000, -6.2717400000000003, 53.364929000000004], [1353942644000000, -6.2709070000000002, 53.364432999999998], [1353942666000000, -6.26776, 53.363686000000001], [1353942686000000, -6.2654079999999999, 53.363147999999995], [1353942704000000, -6.2640769999999995, 53.362843000000005], [1353942725000000, -6.2613719999999997, 53.362197999999999], [1353942745000000, -6.2600709999999999, 53.361881000000004], [1353942764000000, -6.2599489999999998, 53.361851000000001], [1353942784000000, -6.2599489999999998, 53.361851000000001], [1353942807000000, -6.2599489999999998, 53.361851000000001], [1353942825000000, -6.2596050000000005, 53.361556999999998], [1353942845000000, -6.2601420000000001, 53.360928000000001], [1353942866000000, -6.2601420000000001, 53.360928000000001], [1353942884000000, -6.2606099999999998, 53.360450999999998], [1353942905000000, -6.26098, 53.360065000000006], [1353942925000000, -6.2617099999999999, 53.359287000000002], [1353942948000000, -6.261787, 53.359206999999998], [1353942964000000, -6.261787, 53.359206999999998], [1353942985000000, -6.2622749999999998, 53.358733999999998], [1353943008000000, -6.2625779999999995, 53.358481999999995], [1353943024000000, -6.2632959999999995, 53.357925000000002], [1353943046000000, -6.2637279999999995, 53.357574], [1353943065000000, -6.2646050000000004, 53.356716000000006], [1353943084000000, -6.2651199999999996, 53.356186000000001], [1353943107000000, -6.2657999999999996, 53.355400000000003], [1353943125000000, -6.2673249999999996, 53.353831999999997], [1353943144000000, -6.266483, 53.352249], [1353943168000000, -6.2648010000000003, 53.353034999999998], [1353943184000000, -6.2627090000000001, 53.353790000000004], [1353943205000000, -6.2610730000000006, 53.352111999999998], [1353943226000000, -6.2610730000000006, 53.352111999999998], [1353943244000000, -6.2610749999999999, 53.352116000000002], [1353943267000000, -6.2610749999999999, 53.352116000000002], [1353943287000000, -6.2610749999999999, 53.352116000000002], [1353943306000000, -6.2611749999999997, 53.352347999999999], [1353943324000000, -6.2611220000000003, 53.352692000000005], [1353943365000000, -6.2605680000000001, 53.352961999999998], [1353943386000000, -6.2602330000000004, 53.353130000000007], [1353943406000000, -6.2601459999999998, 53.353172000000001], [1353943427000000, -6.2601459999999998, 53.353172000000001], [1353943445000000, -6.2601459999999998, 53.353172000000001], [1353943466000000, -6.2601459999999998, 53.353172000000001], [1353943484000000, -6.2601459999999998, 53.353172000000001], [1353943504000000, -6.2601459999999998, 53.353172000000001], [1353943527000000, -6.2601459999999998, 53.353172000000001], [1353943545000000, -6.2601459999999998, 53.353172000000001], [1353943566000000, -6.2601459999999998, 53.353172000000001], [1353943586000000, -6.2601459999999998, 53.353172000000001], [1353943605000000, -6.2601459999999998, 53.353172000000001], [1353943627000000, -6.2601459999999998, 53.353172000000001], [1353943644000000, -6.2606839999999995, 53.353168000000004], [1353943646000000, -6.2606999999999999, 53.353149000000002]]
4 | [[1353948946000000, -6.2604169999999995, 53.346615], [1353948967000000, -6.2604169999999995, 53.346615], [1353948985000000, -6.2604169999999995, 53.346615], [1353949005000000, -6.2604169999999995, 53.346615], [1353949026000000, -6.2604169999999995, 53.346615], [1353949044000000, -6.2604169999999995, 53.346615], [1353949065000000, -6.2604169999999995, 53.346615], [1353949088000000, -6.2604169999999995, 53.346615], [1353949107000000, -6.2604169999999995, 53.346615], [1353949126000000, -6.2604169999999995, 53.346615], [1353949145000000, -6.2604169999999995, 53.346615], [1353949165000000, -6.2604169999999995, 53.346615], [1353949186000000, -6.2604169999999995, 53.346615], [1353949205000000, -6.2604169999999995, 53.346615], [1353949226000000, -6.2604169999999995, 53.346615], [1353949247000000, -6.2606160000000006, 53.346592000000001], [1353949265000000, -6.261622, 53.346359], [1353949286000000, -6.2616930000000002, 53.346340000000005], [1353949305000000, -6.2626119999999998, 53.346127000000003], [1353949325000000, -6.2637470000000004, 53.345923999999997], [1353949346000000, -6.2640120000000001, 53.345886], [1353949366000000, -6.2654839999999998, 53.345661], [1353949385000000, -6.2654839999999998, 53.345661], [1353949408000000, -6.2661760000000006, 53.345554000000007], [1353949424000000, -6.2677300000000002, 53.345344999999995], [1353949446000000, -6.2694599999999996, 53.345199999999998], [1353949465000000, -6.2695349999999994, 53.345192000000004], [1353949485000000, -6.2713559999999999, 53.345036], [1353949506000000, -6.2716880000000002, 53.345008999999997], [1353949525000000, -6.2716880000000002, 53.345008999999997], [1353949547000000, -6.2727919999999999, 53.345016000000001], [1353949566000000, -6.2737410000000002, 53.345096999999996], [1353949586000000, -6.2756040000000004, 53.345249000000003], [1353949605000000, -6.277304, 53.345546999999996], [1353949626000000, -6.2782730000000004, 53.345734], [1353949646000000, -6.279674, 53.345996999999997], [1353949665000000, -6.2805839999999993, 53.346164999999999], [1353949686000000, -6.2833139999999998, 53.346451000000002], [1353949706000000, -6.2861970000000005, 53.346587999999997], [1353949725000000, -6.289879, 53.346756000000006]]
5 | [[1353949766000000, -6.2935870000000005, 53.345939999999999], [1353949785000000, -6.2938419999999997, 53.345950999999999], [1353949808000000, -6.2944199999999997, 53.345908999999999], [1353949825000000, -6.2951489999999994, 53.345859999999995], [1353949846000000, -6.2980859999999996, 53.345595999999993], [1353949866000000, -6.3021630000000002, 53.345001000000003], [1353949884000000, -6.305758, 53.343924999999999], [1353949906000000, -6.3079499999999999, 53.343020999999993], [1353949926000000, -6.3079070000000002, 53.342143999999998], [1353949945000000, -6.3099930000000004, 53.342140000000001], [1353949968000000, -6.3111350000000002, 53.342228000000006], [1353949985000000, -6.3143820000000002, 53.342213000000001], [1353950007000000, -6.3153930000000003, 53.341994999999997], [1353950026000000, -6.3178679999999998, 53.341712999999999], [1353950047000000, -6.3188269999999997, 53.341614], [1353950067000000, -6.320354, 53.341560000000001], [1353950086000000, -6.3210000000000006, 53.341526000000002], [1353950104000000, -6.3236460000000001, 53.341510999999997], [1353950127000000, -6.3243679999999998, 53.341693999999997], [1353950146000000, -6.3269219999999997, 53.342059999999996], [1353950166000000, -6.3273589999999995, 53.342071999999995], [1353950189000000, -6.3289800000000005, 53.342178000000004], [1353950205000000, -6.3293280000000003, 53.341629000000005], [1353950227000000, -6.3319960000000002, 53.341956999999994], [1353950246000000, -6.3336220000000001, 53.341498999999999], [1353950267000000, -6.334009, 53.341418999999995], [1353950285000000, -6.3365980000000004, 53.340907999999999], [1353950306000000, -6.3380039999999997, 53.340679000000002], [1353950324000000, -6.3392999999999997, 53.340472999999996], [1353950348000000, -6.3418289999999997, 53.339908999999999], [1353950365000000, -6.342651, 53.339737], [1353950386000000, -6.3445849999999995, 53.339362999999999], [1353950405000000, -6.3457889999999999, 53.339127000000005], [1353950426000000, -6.3463769999999995, 53.339011999999997], [1353950447000000, -6.3464710000000002, 53.338242000000001], [1353950465000000, -6.3463799999999999, 53.337940000000003], [1353950486000000, -6.3466760000000004, 53.337775999999998], [1353950506000000, -6.346984, 53.337715000000003], [1353950525000000, -6.3473800000000002, 53.337639000000003], [1353950548000000, -6.3479849999999995, 53.338633999999999], [1353950565000000, -6.3481180000000004, 53.338867000000008], [1353950585000000, -6.3484370000000006, 53.340237000000002], [1353950606000000, -6.3485360000000002, 53.340972999999998], [1353950625000000, -6.3488660000000001, 53.341285999999997], [1353950645000000, -6.348687, 53.341681999999992], [1353950668000000, -6.3499550000000005, 53.342236], [1353950685000000, -6.3520139999999996, 53.342140000000001], [1353950707000000, -6.3528349999999998, 53.342162999999999], [1353950725000000, -6.3535839999999997, 53.342216000000001], [1353950748000000, -6.356471, 53.342442000000005], [1353950766000000, -6.3583699999999999, 53.342593999999991], [1353950786000000, -6.3586989999999997, 53.342620999999994], [1353950806000000, -6.3595829999999998, 53.342693000000004], [1353950825000000, -6.3597960000000002, 53.342711999999999], [1353950846000000, -6.3615760000000003, 53.342868999999993], [1353950865000000, -6.3618290000000002, 53.341609999999996], [1353950885000000, -6.3617800000000004, 53.340954000000004], [1353950908000000, -6.3614420000000003, 53.339401000000002], [1353950925000000, -6.3612279999999997, 53.338893999999996]]
6 | [[1353931284000000, -6.2608670000000002, 53.352814000000002], [1353931325000000, -6.2608670000000002, 53.352814000000002], [1353931333000000, -6.2645960000000001, 53.352901000000003], [1353931343000000, -6.2668370000000007, 53.354191], [1353931364000000, -6.268008, 53.354808999999996], [1353931382000000, -6.2682010000000004, 53.355708999999997], [1353931403000000, -6.2680579999999999, 53.356480000000005], [1353931426000000, -6.2687999999999997, 53.357830000000007], [1353931444000000, -6.2696459999999998, 53.358798999999998], [1353931462000000, -6.2697500000000002, 53.359607999999994], [1353931485000000, -6.2696990000000001, 53.359966], [1353931503000000, -6.2696819999999995, 53.360081000000008], [1353931524000000, -6.2696819999999995, 53.360081000000008], [1353931542000000, -6.2696819999999995, 53.360081000000008], [1353931563000000, -6.2696709999999998, 53.360165000000002], [1353931583000000, -6.2701310000000001, 53.360626000000003], [1353931602000000, -6.2703259999999998, 53.360638000000002], [1353931623000000, -6.2703259999999998, 53.360638000000002], [1353931643000000, -6.2705510000000002, 53.360649000000002], [1353931668000000, -6.2717800000000006, 53.360737], [1353931695000000, -6.271884, 53.360743999999997], [1353931704000000, -6.271884, 53.360743999999997], [1353931724000000, -6.271884, 53.360743999999997], [1353931745000000, -6.2721689999999999, 53.360764000000003], [1353931763000000, -6.2751220000000005, 53.360802], [1353931806000000, -6.277247, 53.360828000000005], [1353931825000000, -6.2791399999999999, 53.360911999999999], [1353931843000000, -6.2816410000000005, 53.361000000000004], [1353931866000000, -6.283207, 53.361065000000004], [1353931884000000, -6.2831929999999998, 53.361561000000002], [1353931902000000, -6.2831429999999999, 53.361752000000003], [1353931925000000, -6.2827349999999997, 53.363205000000008], [1353931944000000, -6.2827230000000007, 53.363822999999996], [1353931964000000, -6.2857389999999995, 53.364437000000002], [1353931987000000, -6.2881710000000002, 53.364688999999998], [1353932003000000, -6.2894639999999997, 53.365581999999996], [1353932023000000, -6.2913969999999999, 53.366505000000004], [1353932044000000, -6.2915359999999998, 53.366539000000003], [1353932064000000, -6.291779, 53.367095999999997], [1353932085000000, -6.2915070000000002, 53.367538000000003], [1353932105000000, -6.2911320000000002, 53.368209999999998], [1353932124000000, -6.2913949999999996, 53.369094999999994], [1353932144000000, -6.2937730000000007, 53.369865000000004], [1353932165000000, -6.2965179999999998, 53.370387999999998], [1353932185000000, -6.2995919999999996, 53.370982999999995], [1353932203000000, -6.3011460000000001, 53.371265000000001], [1353932224000000, -6.3035709999999998, 53.371295999999994], [1353932242000000, -6.30389, 53.371288], [1353932263000000, -6.3046220000000002, 53.370837999999999], [1353932283000000, -6.3044989999999999, 53.370181999999993], [1353932304000000, -6.3039699999999996, 53.369273999999997], [1353932324000000, -6.304278, 53.369002999999999], [1353932345000000, -6.3048800000000007, 53.368648999999998], [1353932363000000, -6.3061389999999999, 53.370036999999996], [1353932384000000, -6.3059370000000001, 53.371552000000001], [1353932404000000, -6.3063000000000002, 53.373093000000004], [1353932423000000, -6.3078029999999998, 53.374268000000008], [1353932444000000, -6.3089490000000001, 53.375011000000001], [1353932464000000, -6.3099509999999999, 53.375900000000001], [1353932485000000, -6.3102099999999997, 53.376231999999995], [1353932503000000, -6.311852, 53.375838999999999], [1353932526000000, -6.3142879999999995, 53.375709999999998], [1353932543000000, -6.3167169999999997, 53.375725000000003], [1353932563000000, -6.3168819999999997, 53.375729000000007], [1353932584000000, -6.3190540000000004, 53.375751000000001], [1353932604000000, -6.321472, 53.375956999999993], [1353932625000000, -6.3236489999999996, 53.376980000000003], [1353932643000000, -6.3249870000000001, 53.37735], [1353932666000000, -6.3267259999999998, 53.377231999999992], [1353932684000000, -6.3302069999999997, 53.377239000000003], [1353932704000000, -6.3309670000000002, 53.377582999999994], [1353932723000000, -6.3309670000000002, 53.377582999999994], [1353932766000000, -6.3309670000000002, 53.377582999999994]]
7 |
--------------------------------------------------------------------------------
/train_set.csv.zip:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jim-spyropoulos/Trajectory-Analysis-and-Classification-in-Python-Pandas-and-Scikit-Learn/5078fd47122e6a0a93c08e068d62281aedf91baf/train_set.csv.zip
--------------------------------------------------------------------------------