-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·255 lines (244 loc) · 12.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang=""> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="apple-touch-icon" href="apple-touch-icon.png">
<link rel="stylesheet" href="css/bootstrap.min.css">
<style>
body {
padding-top: 50px;
padding-bottom: 20px;
}
</style>
<!--<link rel="stylesheet" href="css/bootstrap-theme.min.css" />-->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.2/dist/leaflet.css" />
<script src="js/vendor/modernizr-2.8.3-respond-1.4.2.min.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
},
"HTML-CSS": { linebreaks: { automatic: true } },
SVG: { linebreaks: { automatic: true } }
});
</script>
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</head>
<body>
<!--[if lt IE 8]>
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- <a class="navbar-brand">ADA-Orion</a> -->
</div>
<!--/.navbar-collapse -->
</div>
</nav>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>Twinhoods
<br>
<small>Matching Lausanne's neighborhoods with similar counterparts in Zürich and vice-versa.</small>
</h1>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-3">
</div>
<div class="col-md-6">
<form name=descriptorSelect>
<input type="radio" name=descriptor value="all" checked>All Places
<input type="radio" name=descriptor value="landmarks">Landmarks
<input type="radio" name=descriptor value="fastfood" >Fastfood
<input type="radio" name=descriptor value="travel" >Travel
<input type="radio" name=descriptor value="sports" >Sports
</form>
</div>
<div class="col-md-3">
</div>
</div>
<div class="row">
<div class="col-md-6">
<h2>Lausanne</h2>
<div class="map" id="map-lausanne">
</div>
</div>
<div class="col-md-6">
<h2>Zürich</h2>
<div class="map" id="map-zurich"></div>
</div>
</div>
<hr class="featurette-devider">
<div class="row featurette vcenter_row">
<div class="col-sm-8">
<h2 class="featurette-heading">Data aquisition</h2>
<p class="lead">
In order to map the neighborhoods, we needed to get openly available
geotagged data which would be comparable across cities.
We decided to make our prototype based on the localization of
resturants, shops, landmarks and other venues. The gathering of this
data proved to be harder than expected, as our source was restricted
in terms of number of results in an area and rate limitations. We
tackled the problem by querying
<a href src="http://developer.factual.com/">Factual Places API</a>
in a uniform grid such that the number of queries were minimized,
while we still obtained all places. As a result we ended up scraping
<b>~13,500</b> locations for <b>Lausanne</b> and <b>~45,000</b> for <b>Zürich</b>.
Last but not least, we have programmed the crawler to walk the defined
area in a spiral fashion to make sure to retrieve the most important
areas first and set a prioritiy path in case of unexpected interruption.</p>
</div>
<div class="col-sm-4">
<img class="featurette-image img-responsive center-block" data-src="" alt="Data aquisition" src="img/Handle-With-Care-256.png">
</div>
</div>
<hr class="featurette-devider">
<div class="row featurette vcenter_row">
<div class="col-sm-8">
<h2 class="featurette-heading">Preprocessing</h2>
<p class="lead">
After gathering the data, we had to assign each place to a neighborhood.
As there are no publicly available geodata on neighborhoods in Switzerland,
we spent some time crawling the web for this information.
In the end we found custom google maps overlays, which after convertion
we were able to use as geojson. We then had the limits of each neighborhood
as geographical coordinates, and we could just map each
venue to their neighborhood. The next steps consisted of finding good
features for the model to base the predictions on, the details of this
process can be found in a jupyter notebook at
<a href="https://github.com/PaluchowskiMatthew/ADA-Orion/blob/master/Lausanne%20%26%20Zurich%20places.ipynb">github.com</a>
</p>
</div>
<div class="col-sm-4">
<img class="featurette-image img-responsive center-block" data-src="" alt="Preprocessing" src="img/Mixer-256.png" data-holder-rendered="true">
</div>
</div>
<hr class="featurette-devider">
<div class="row featurette vcenter_row">
<div class="col-sm-8">
<h2 class="featurette-heading">Descriptors</h2>
<p class="lead">
In order to extract meaniningful and descriptive information for a
particular neighborhood, we have decided to use venue densities.
Since from the used Factual API, we had a selection of <b>467</b> different <b>venue
types</b> available, which can be found
<a href="http://developer.factual.com/working-with-categories/#taxonomy">here</a>.
We have created different descriptor vectors that can be selected
via radio button above (All Places, Landmarks, Fastfood, Travel, Sports).
These descriptor vectors consist of a normalized frequency analysis
of a set of described venue types within particular neighborhood.
These feature vectors are ultimately being compared in
order to find a best matching as described in the next section.
</p>
</div>
<div class="col-sm-4">
<img class="featurette-image img-responsive center-block" data-src="" alt="Descriptors" src="img/Tag-256.png" data-holder-rendered="true">
</div>
</div>
<hr class="featurette-devider">
<div class="row featurette vcenter_row">
<div class="col-sm-8">
<h2 class="featurette-heading">Matching</h2>
<p class="lead">
We find a best matching between a freely chosen neighborhood
and its corresponding descriptor $\vec n_i^A$ from the origin city $A$
and a corresponding target neighborhood with descriptor $\vec n_j^B$
in the target city $B$ by mapping to the closest descriptor
in the target city as follows:
<div class="formula">
$$ \| \vec n_i^A - \vec n_j^B \|^2 \leq \| \vec n_i^A - \vec n_k^B \|^2 \quad \forall k \neq j $$
</div>
<div class="lead">
By expanding the above formula we can show that maximizing the dot
product between neighborhood descriptors will actually result in the
closest match for neighborhood $n_i$,
</div>
<div class="formula">
$$ (\vec n_i^A)^2 - 2 (\vec n_i^A)^T \vec n_j^B + (\vec n_j^B)^2 \leq (\vec n_i^A)^2 - 2 (\vec n_i^A)^T \vec n_k^B + (\vec n_k^B)^2 $$
</div>
<div class="lead">
Since we have normalized the descriptor vectors above we have
</div>
<div class="formula">
$$ (\vec n_i^A)^2 = (\vec n_j^B)^2 = (\vec n_k^B)^2 = 1 \quad \forall i,j,k$$
$$ - 2 (\vec n_i^A)^T \vec n_j^B \leq - 2 (\vec n_i^A)^T \vec n_k^B $$
</div>
<div class="lead">
Dividing the above inequation by $-2$ including the corresponding
flip to the inequality sign results in
</div>
<div class="formula">
$$ (\vec n_i^A)^T \vec n_j^B \geq (\vec n_i^A)^T \vec n_k^B $$
</div>
<div class="lead">
This shows that the closest neighborhood can be found be finding
the maximal dot product between the chosen origin neighborhood
descriptor and the set of target neighborhood descriptors $\vec n_j^B$.</p>
</div>
</div>
<div class="col-sm-4">
<img class="featurette-image img-responsive" data-src="" alt="Matching" src="img/Node-256.png" data-holder-rendered="true">
</div>
</div>
<hr class="featurette-devider">
<div class="row featurette vcenter_row">
<div class="col-sm-8">
<h2 class="featurette-heading">Visualization</h2>
<p class="lead">
The final neighborhood mappings are subsequently visualized on their
respective communal defined polygons using
<a href="http://leafletjs.com/">leaflet</a> maps that have been
enhanced to provide the needed interactivity.
</p>
</div>
<div class="col-sm-4">
<img class="featurette-image img-responsive center-block" data-src="" alt="Visualization" src="img/Map-Location-256.png" data-holder-rendered="true">
</div>
</div>
<footer>
<p>
<a href="https://github.com/aurlien">Kristian Aurlien</a>,
<a href="https://github.com/PaluchowskiMatthew">Mateusz Paluchowski</a> and
<a href="https://github.com/raccc">Christian Tresch</a> as
<a href="https://github.com/PaluchowskiMatthew/ADA-Orion">ADA-Orion</a> © 2017</p>
</footer>
</div> <!-- /container --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
<script src="js/vendor/bootstrap.min.js"></script>
<script src="https://unpkg.com/leaflet@1.0.2/dist/leaflet.js"></script>
<script src="js/leaflet.ajax.min.js"></script>
<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
<script src="js/main.js"></script>
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='//www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X','auto');ga('send','pageview');
</script>
</body>
</html>