-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodels.html
More file actions
556 lines (512 loc) · 26.4 KB
/
models.html
File metadata and controls
556 lines (512 loc) · 26.4 KB
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<meta name="description" content="">
<meta name="author" content="">
<title>模型分析及其结果</title>
<!-- Loading Bootstrap -->
<link href="Flat-UI-master/dist/css/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- Loading Flat UI -->
<link href="Flat-UI-master/dist/css/flat-ui.css" rel="stylesheet">
<link rel="shortcut icon" href="Flat-UI-master/dist/img/favicon.ico">
<link rel="stylesheet" href="leaflet/awesome-markers/leaflet.awesome-markers.css">
<link href="https://use.fontawesome.com/releases/v5.0.6/css/all.css" rel="stylesheet">
<link href="map.css" rel="stylesheet">
<!-- <link href="css/mycss.css" rel="stylesheet">-->
<style>
/* Custom Styles */
ul.nav-tabs {
width: 140px;
margin-top: 50px;
border-radius: 0;
border: 1px solid #ddd;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.067);
}
ul.nav-tabs li {
margin: 0;
border-top: 1px solid #ddd;
}
ul.nav-tabs li:first-child {
border-top: none;
}
ul.nav-tabs li a {
margin: 0;
padding: 8px 16px;
border-radius: 0;
}
ul.nav-tabs li.active a,
ul.nav-tabs li.active a:hover {
color: #fff;
background: #0088cc;
border: 1px solid #0088cc;
}
ul.nav-tabs li:first-child a {
border-radius: 0;
}
ul.nav-tabs li:last-child a {
border-radius: 0;
}
ul.nav-tabs.affix {
top: 100px;
/* Set the top position of pinned element */
}
</style>
</head>
<body data-spy="scroll" data-target="#myScrollspy">
<nav class="navbar navbar-inverse navbar-fixed-top">
<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" href="#">写字楼时空数据展示</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="overview.html">预览</a></li>
<li><a href="index.html">主页</a></li>
<li><a href="statistics.html">统计分析</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">地图<b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="heatmap.html">热力图</a></li>
<li><a href="clustering.html">聚合图</a></li>
</ul>
</li>
<li class="active"><a href="models.html">模型分析</a></li>
</ul>
<!--<form class="navbar-form navbar-right">-->
<!--<div class="form-group">-->
<!--<input type="text" placeholder="Email" class="form-control">-->
<!--</div>-->
<!--<div class="form-group">-->
<!--<input type="password" placeholder="Password" class="form-control">-->
<!--</div>-->
<!--<button type="submit" class="btn btn-success">Sign in</button>-->
<!--</form>-->
</div>
<!--/.navbar-collapse -->
</div>
</nav>
<div class="container" style="margin-top: 80px">
<div class="row">
<div class="col-xs-2" id="myScrollspy">
<ul class="nav nav-tabs nav-stacked" data-spy="affix" data-offset-top="125">
<li class="active"><a href="#section-0">数据概况</a></li>
<li><a href="#section-1">数据分析</a></li>
<li><a href="#section-2">回归模型</a></li>
<li><a href="#section-3">租金聚类</a></li>
<li><a href="#section-4">分类模型</a></li>
<li><a href="#top" style="color: black">回到顶部</a></li>
</ul>
</div>
<div class="col-xs-10">
<div class="panel panel-default" id="section-0">
<div class="panel-heading">
<h3 class="panel-title">数据概况</h3>
</div>
<div class="panel-body">
<h5>数据属性</h5>
<p>共搜集得到1875个写字楼信息,即1875条写字楼数据,每条数据均有如下属性:<b>type 等级(甲乙丙三个等级)、floors 楼层数、
age 写字楼年龄</b> 以及 <b>rent 写字楼平均租金(元/m²⋅天)</b></p>
<p>除此之外,还通过调用<a href="http://lbsyun.baidu.com/index.php?title=jspopular3.0">百度地图api</a>获取写字楼周边特定POI信息,并作为改写字楼的额外属性,如下:
<b>hotel (周边600m内旅馆数)、hospital (周边600m内医院数)、mall (周边600m内商场数)、 park1500 (周边1500m内公元数)、
store (周边600m内便利店数)、
underground (周边600m内地铁数)、 POIs (上述POI类别数)</b></p>
<p style="color: #d82334">POI半径设为600m对应平均步程10分钟,由于公园的特殊性,将其半径设为1500m</p>
<p><b>dummy数据</b>:将类别属性如写字楼等级这样无法用数值表示的属性,转换为数值属性,相见数据预览</p>
<hr>
<h5 style="margin-top: 30px">数据预览</h5>
<p><b>原数据:</b></p>
<table class="table table-bordered">
<thead>
<tr>
<th>name</th>
<th style="color: red">type</th>
<th>age</th>
<th>floors</th>
<th>rent</th>
<th>hotel</th>
<th>hospital</th>
<th>mall</th>
<th>store</th>
<th>park1500</th>
<th>underground</th>
<th>POIs</th>
</tr>
</thead>
<tbody>
<tr>
<th>瑅香广场</th>
<th style="color: red">丙</th>
<th>4</th>
<th>NaN</th>
<th>3.55</th>
<th>18</th>
<th>0</th>
<th>3</th>
<th>7</th>
<th>24</th>
<th>0</th>
<th>5</th>
</tr>
<tr>
<th>银历大厦</th>
<th style="color: red">丙</th>
<th>NaN</th>
<th>NaN</th>
<th>3.04</th>
<th>39</th>
<th>4</th>
<th>11</th>
<th>10</th>
<th>52</th>
<th>2</th>
<th>7</th>
</tr>
<tr>
<th>昇PARK创意园</th>
<th style="color: red">丙</th>
<th>2</th>
<th>5</th>
<th>2.54</th>
<th>1</th>
<th>0</th>
<th>2</th>
<th>0</th>
<th>13</th>
<th>0</th>
<th>4</th>
</tr>
</tbody>
</table>
<p><b>dummy数据:</b></p>
<table class="table table-bordered">
<thead>
<tr>
<th>name</th>
<th style="color: red">JIA</th>
<th style="color: red">YI</th>
<th style="color: red">BING</th>
<th>age</th>
<th>floors</th>
<th>rent</th>
<th>hotel</th>
<th>hospital</th>
<th>mall</th>
<th>store</th>
<th>park1500</th>
<th>underground</th>
<th>POIs</th>
</tr>
</thead>
<tbody>
<tr>
<th>瑅香广场</th>
<th style="color: red">0</th>
<th style="color: red">0</th>
<th style="color: red">1</th>
<th>4</th>
<th>NaN</th>
<th>3.55</th>
<th>18</th>
<th>0</th>
<th>3</th>
<th>7</th>
<th>24</th>
<th>0</th>
<th>5</th>
</tr>
<tr>
<th>银历大厦</th>
<th style="color: red">0</th>
<th style="color: red">0</th>
<th style="color: red">1</th>
<th>NaN</th>
<th>NaN</th>
<th>3.04</th>
<th>39</th>
<th>4</th>
<th>11</th>
<th>10</th>
<th>52</th>
<th>2</th>
<th>7</th>
</tr>
<tr>
<th>昇PARK创意园</th>
<th style="color: red">0</th>
<th style="color: red">0</th>
<th style="color: red">1</th>
<th>2</th>
<th>5</th>
<th>2.54</th>
<th>1</th>
<th>0</th>
<th>2</th>
<th>0</th>
<th>13</th>
<th>0</th>
<th>4</th>
</tr>
</tbody>
</table>
<hr>
<h5 style="margin-top: 30px">建模目的</h5>
<p>分析写字楼租金与该楼盘自身属性以及周边POIs之间的关系,通过机器学习预测某一新写字楼的租金</p>
</div>
</div>
<div class="panel panel-info" id="section-1">
<div class="panel-heading">
<h3 class="panel-title">数据分析</h3>
</div>
<div class="panel-body">
<h5>租金概况</h5>
<p>对1875条数据的租金信息进行基础统计分析,得到如下结果:</p>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>最小值</th>
<th>最大值</th>
<th>平均值</th>
<th>中位值</th>
<th>标准差</th>
</tr>
</thead>
<tbody>
<tr>
<th>租金 (元/m²⋅天)</th>
<th>0.03</th>
<th>13.35</th>
<th>4.26</th>
<th>3.85</th>
<th>1.88</th>
</tr>
</tbody>
</table>
<p><b>租金分布图:</b></p>
<div class="panel"><img src="imgs/rents.png" class="img-responsive"></div>
<hr>
<h5 style="margin-top: 30px">租金与属性的相关性分析</h5>
<p><b>租金与各属性的关系:</b></p>
<div class="panel"><img src="imgs/scatters_plot.png" class="img-responsive"></div>
<p><b><a href="https://en.wikipedia.org/wiki/Pearson_correlation_coefficient">皮尔森相关系数</a>热力图:</b>
</p>
<div class="panel"><img src="imgs/corrs.png" class="img-responsive"></div>
<p><b>租金与各属性的相关系数</b></p>
<table class="table table-striped">
<thead>
<tr>
<th></th>
<th>type</th>
<th>age</th>
<th>floors</th>
<th>hotel</th>
<th>hospital</th>
<th>mall</th>
<th>store</th>
<th>park1500</th>
<th>underground</th>
<th>POIs</th>
</tr>
</thead>
<tbody>
<tr>
<th>Pearson Corr (0-1)</th>
<th>0.2</th>
<th>0.067</th>
<th>0.41</th>
<th>0.27</th>
<th>0.22</th>
<th>0.32</th>
<th>0.37</th>
<th>0.28</th>
<th>0.22</th>
<th>0.24</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-success" id="section-2">
<div class="panel-heading">
<h3 class="panel-title">回归模型</h3>
</div>
<div class="panel-body">
<h5>回归模型以及结果</h5>
<p>将现有数据划分训练集(80%)和测试集(20%),建立多个回归模型,分别对现有数据进行训练,并对预测集上的租金属性进行预测,通过模型优化以期提升预测准确率</p>
<p>选用的回归模型有:<b><a href="https://en.wikipedia.org/wiki/Decision_tree_learning">DecisionTree</a>、<a
href="https://en.wikipedia.org/wiki/Linear_regression">LinearRegression</a>、<a
href="https://en.wikipedia.org/wiki/Support_vector_machine">SVM</a>、<a
href="http://keras-cn.readthedocs.io/en/latest/models/sequential/">Sequential</a></b></p>
<p>预测结果的度量:<b><a href="https://en.wikipedia.org/wiki/Coefficient_of_determination">R平方</a>,即决定系数</b>,范围是0-1,数值越大则说明预测效果越好,越接近真实值
</p>
<p><b>结果:</b></p>
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>DecisionTree</th>
<th>LinearRegression</th>
<th>SVM</th>
<th>Sequential</th>
</tr>
</thead>
<tbody>
<tr>
<th>原数据</th>
<th>0.35</th>
<th>0.31</th>
<th>0.38</th>
<th>0.27</th>
</tr>
<tr>
<th>dummy数据</th>
<th>0.35</th>
<th>0.41</th>
<th>0.47</th>
<th>0.47</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-danger" id="section-3">
<div class="panel-heading">
<h3 class="panel-title">租金聚类</h3>
</div>
<div class="panel-body">
<h5>聚类过程和目的</h5>
<p>
<li>利用<a href="https://en.wikipedia.org/wiki/K-means_clustering">Kmeans聚类算法</a>对1875个数据的租金信息(rent)进行聚类,得到租金信息的5个分类。
</li>
<li>将上述所得的5个分类作为5个不同的标签(labels)添加到原数据中,将原来的<b>连续型租金信息</b>转换成<b>离散型租金信息</b>,以便后续分类学习和预测。</li>
<li>利分类监督学习模型对上述所得数据进行训练和预测。</li>
</p>
<hr>
<h5 style="margin-top: 30px">聚类结果</h5>
<p><b>聚类概况:</b></p>
<div class="panel"><img src="imgs/kmeans.png" class="img-responsive"></div>
<p><b>结果示例:</b></p>
<table class="table table-bordered">
<thead>
<tr>
<th>name</th>
<th>type</th>
<th>age</th>
<th>floors</th>
<th style="color: #c60100">rent</th>
<th>hotel</th>
<th>hospital</th>
<th>mall</th>
<th>store</th>
<th>park1500</th>
<th>underground</th>
<th>POIs</th>
<th style="color: red">label5</th>
</tr>
</thead>
<tbody>
<tr>
<th>瑅香广场</th>
<th>丙</th>
<th>4</th>
<th>NaN</th>
<th style="color: #c60100">3.55</th>
<th>18</th>
<th>0</th>
<th>3</th>
<th>7</th>
<th>24</th>
<th>0</th>
<th>5</th>
<th style="color: red">4</th>
</tr>
<tr>
<th>银历大厦</th>
<th>丙</th>
<th>NaN</th>
<th>NaN</th>
<th style="color: #c60100">3.04</th>
<th>39</th>
<th>4</th>
<th>11</th>
<th>10</th>
<th>52</th>
<th>2</th>
<th>7</th>
<th style="color: red">4</th>
</tr>
<tr>
<th>昇PARK创意园</th>
<th>丙</th>
<th>2</th>
<th>5</th>
<th style="color: #c60100">2.54</th>
<th>1</th>
<th>0</th>
<th>2</th>
<th>0</th>
<th>13</th>
<th>0</th>
<th>4</th>
<th style="color: red">4</th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-warning" id="section-4">
<div class="panel-heading">
<h3 class="panel-title">分类模型</h3>
</div>
<div class="panel-body">
<h5>分类模型以及结果</h5>
<p>将现有数据划分训练集(80%)和测试集(20%),建立多个分类模型,分别对现有数据进行训练,并对预测集上的租金进行所属范围的预测,通过模型优化以期提升预测准确率</p>
<p>选用的分类模型有:<b><a href="https://en.wikipedia.org/wiki/Decision_tree_learning">DecisionTree</a>、<a
href="https://en.wikipedia.org/wiki/Naive_Bayes_classifier">NaiveBayes</a>、<a
href="https://en.wikipedia.org/wiki/Support_vector_machine">SVM</a></b></p>
<p>预测结果的度量:<b>预测准确率</b>,即预测对的个数所占测试集的比重,范围是0-1,数值越大则说明预测效果越好,越接近真实值
</p>
<p><b>结果:</b></p>
<table class="table table-bordered">
<thead>
<tr>
<th></th>
<th>DecisionTree</th>
<th>NaiveBayes</th>
<th>SVM</th>
</tr>
</thead>
<tbody>
<tr>
<th>原数据</th>
<th>35%</th>
<th>32%</th>
<th>43</th>
</tr>
<tr>
<th>dummy数据</th>
<th>44%</th>
<th>38%</th>
<th>48%</th>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="Flat-UI-master/dist/js/vendor/jquery.min.js"></script>
<script src="Flat-UI-master/dist/js/flat-ui.min.js"></script>
</body>
</html>