92
Gabriel Martins Dias*, Boris Bellalta, Simon Oechsner Universitat Pompeu Fabra, Barcelona, Spain Predicting occupancy trends in Barcelona's bicycle service stations using open data SAI Intelligent Systems Conference 2015 10-11 November 2015 | London UK

Predicting occupancy trends in Barcelona's bicycle service stations using open data

Embed Size (px)

Citation preview

Page 1: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Gabriel Martins Dias*, Boris Bellalta, Simon Oechsner

Universitat Pompeu Fabra, Barcelona, Spain

Predicting occupancy trends in Barcelona's bicycle service stations using open data

SAI Intelligent Systems Conference 2015 10-11 November 2015 | London UK

Page 2: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Bicing

Page 3: Predicting occupancy trends in Barcelona's bicycle service stations using open data

BicingThe public bicycle system of Barcelona is called “Bicing” and it made

for local citizens. In order to use it, people have to pay an annual fee

that lets them borrow a bike for 30 minutes without any extra cost.

If the trip lasts longer than 30 minutes and less than 2 hours, a small

fee is applied. Otherwise, if it lasts longer than 2 hours the fee is much

more expensive.

Therefore, most of the trips (97%) last less than 30 minutes.

Page 4: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Barcelona

Page 5: Predicting occupancy trends in Barcelona's bicycle service stations using open data

BarcelonaThis is the map of Barcelona.

At the bottom, we can observe the sea. The terrain is not flat and the

highest altitude is over 100 meters above the sea level.

Page 6: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Bicing stations

352

351

311

353

354

313355

184

179

404

345

346

347348

349

185

180 181

314 192

188

183

182

312193

236

237

9493

95420

96

210 18697

100384

421

9899

201200

194

198

196

195

366

74

102101

197367

319231

107220

222

223

106

226

108

122

318

277

28

278

21

20

279

164 280

77

241

315239

253

340

341

317

251

247246 250

252249

391423

240

248

289238

104

103 127

339

129

128

316

130 131

109 350 88

75

67

87

191

365

89 90

76

385

68

73 72

139

138

137

136

147

157

146

145

156155

135

134

132

133 141

159158

160168

178

162

167

176174

175

144

150

153 154 382

165

166

173

190

225

11083 80

84 209

81 111

262140

82

92 374

364

6061

411

78 79 406

224

27

189123

29

19

370

22

18

120 121

26

371

218

43

44 42

286

342

142211 143

369

3024

1

372426

119

1617

48

393151

428

161

163

149

409

172 171170 169

49

117396

397

45392

47

407408

46

118

25362

15413

23

360

2

414

368

387

363

35934

412 105

66

287

6362

64 65

395

5 6

418 419

7 8

389

358390

34

1369

12125

116

11398

41

424

3839

40

400

32

31 33 124

377

376 375

10

405

914115

361410

402 126

37401

55

378

56

57

114

425

36

35

53

380

52379

5859 51

381388

415

416

54187427

50

232

261

70 71

91

112

113

148

386

85

373

86235

234

233

265

394

152

Page 7: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Bicing stations

352

351

311

353

354

313355

184

179

404

345

346

347348

349

185

180 181

314 192

188

183

182

312193

236

237

9493

95420

96

210 18697

100384

421

9899

201200

194

198

196

195

366

74

102101

197367

319231

107220

222

223

106

226

108

122

318

277

28

278

21

20

279

164 280

77

241

315239

253

340

341

317

251

247246 250

252249

391423

240

248

289238

104

103 127

339

129

128

316

130 131

109 350 88

75

67

87

191

365

89 90

76

385

68

73 72

139

138

137

136

147

157

146

145

156155

135

134

132

133 141

159158

160168

178

162

167

176174

175

144

150

153 154 382

165

166

173

190

225

11083 80

84 209

81 111

262140

82

92 374

364

6061

411

78 79 406

224

27

189123

29

19

370

22

18

120 121

26

371

218

43

44 42

286

342

142211 143

369

3024

1

372426

119

1617

48

393151

428

161

163

149

409

172 171170 169

49

117396

397

45392

47

407408

46

118

25362

15413

23

360

2

414

368

387

363

35934

412 105

66

287

6362

64 65

395

5 6

418 419

7 8

389

358390

34

1369

12125

116

11398

41

424

3839

40

400

32

31 33 124

377

376 375

10

405

914115

361410

402 126

37401

55

378

56

57

114

425

36

35

53

380

52379

5859 51

381388

415

416

54187427

50

232

261

70 71

91

112

113

148

386

85

373

86235

234

233

265

394

152

These are the Bicing stations.

There are 400 stations and over 6,000 bicycles available.

Page 8: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Problem

Page 9: Predicting occupancy trends in Barcelona's bicycle service stations using open data

ProblemIn general, the bicycles help people to travel around the city, to go to

work, to the school, and so on.

However, there are two problems which users face very often:

1. Not finding a bicycle when they want to go somewhere;

2. Not finding a free slot in the station when they arrived to their

destination.

Page 10: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Idea 💡

Page 11: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Idea 💡Plan trips in advance

Page 12: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Idea 💡Plan trips in advance

What if we could plan this before?

Page 13: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Idea

Page 14: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Idea

The idea involves creating an application where anybody can inform

where they want to go and when.

Page 15: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Idea

Page 16: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Idea

Page 17: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Idea

Based on the information provided by the user, it shows a suggestion

about which stations they should use.

Page 18: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

Page 19: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

We observed that for a person that is looking for a bike, it does not

matter whether there are 5, 10 or 50 bicycles available in a station.

However, they want to avoid stations that may be nearly empty.

On the other hand, a person that is looking for a free slot will avoid

stations that are nearly or completely full.

Therefore, we defined such statuses as the critical ones.

Page 20: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

Page 21: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

Look

ing fo

r a bi

ke

Page 22: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

🚫

Look

ing fo

r a bi

ke

Page 23: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

🚫

Look

ing fo

r a bi

ke

Look

ing fo

r a fr

ee sl

ot

Page 24: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

🚫

🚫

Look

ing fo

r a bi

ke

Look

ing fo

r a fr

ee sl

ot

Page 25: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

Page 26: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

Page 27: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

Page 28: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

Page 29: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Levels

Full

Almost full

Bikes and slots available

Almost empty

Empty

Almost Full / Full

Bikes and slots available

Almost empty / Empty

Page 30: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Barcelona - Stations

352

351

307

308

309

311

353

302

310

354

313355

184

179

404

345

346

347348

349

185

180 181

314 192

188

183

182

312

199

193

306

303

236

237

9493

95420

96

210 18697

100384

421

9899

304

305204

337338

334

331

329

332

330

336

335333

325

212

327 326

328

322

214

215

323

324

213203

284 206205

202 207208

201200

194

198

196

195

366

74

102101

197367

216

319219

217

321

320

230

221

228

229

357

227

356

231

107220

222

223

106

226

108

122

276

318

277

28

278

21

20 164 280

77

129

109 350 88

75

67

87

191

365

89 90

76

385

68

73 72

225

11083 80

84 209

81 111

262140

82

92 374

364

6061

411

78 79 406

224

27

189123

29

19

370

22

18

120 121

26

371

218

43

44 42

286

142211

369

3024

1

372426

119

1617

48

428

161

163

149

409

172 171170 169

49

117396

397

45392

47

407408

46

118

25362

15413

23

360

2

414

368

387

363

35934

412 105

66

287

6362

64 65

395

5 6

418 419

7 8

389

358390

34

1369

12125

116

11398

41

424

3839

40

400

32

31 33 124

377

376 375

10

405

914115

361410

402 126

37401

55

378

56

57

114

425

36

35

53

380

52379

5859 51

381388

415

416

54187427

50

232

261

70 71

91

112

113

148

386

85

373

86235

234

233

265

394

Page 31: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Barcelona - Stations

352

351

307

308

309

311

353

302

310

354

313355

184

179

404

345

346

347348

349

185

180 181

314 192

188

183

182

312

199

193

306

303

236

237

9493

95420

96

210 18697

100384

421

9899

304

305204

337338

334

331

329

332

330

336

335333

325

212

327 326

328

322

214

215

323

324

213203

284 206205

202 207208

201200

194

198

196

195

366

74

102101

197367

216

319219

217

321

320

230

221

228

229

357

227

356

231

107220

222

223

106

226

108

122

276

318

277

28

278

21

20 164 280

77

129

109 350 88

75

67

87

191

365

89 90

76

385

68

73 72

225

11083 80

84 209

81 111

262140

82

92 374

364

6061

411

78 79 406

224

27

189123

29

19

370

22

18

120 121

26

371

218

43

44 42

286

142211

369

3024

1

372426

119

1617

48

428

161

163

149

409

172 171170 169

49

117396

397

45392

47

407408

46

118

25362

15413

23

360

2

414

368

387

363

35934

412 105

66

287

6362

64 65

395

5 6

418 419

7 8

389

358390

34

1369

12125

116

11398

41

424

3839

40

400

32

31 33 124

377

376 375

10

405

914115

361410

402 126

37401

55

378

56

57

114

425

36

35

53

380

52379

5859 51

381388

415

416

54187427

50

232

261

70 71

91

112

113

148

386

85

373

86235

234

233

265

394

Recall the map with the Bicing stations.

Page 32: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Barcelona - Stations

Page 33: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Barcelona - Stations

We randomly selected 4 stations to make the predictions.

Page 34: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Open data

Page 35: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Open data

Page 36: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Open data

Page 37: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Open data

Besides considering the number of bicycles, we have also observed

the calendar: the season of the year, the holidays, the weekday, etc..

Page 38: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Open data

Page 39: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Open data

Page 40: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Open data

Moreover, the weather forecast was also checked.

Page 41: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Predictors

Page 42: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Predictors

Page 43: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Predictors

TemperatureRelative humidity☂

Page 44: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Predictors

TemperatureRelative humidity☂

Is it holiday? ✈

Page 45: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Predictors

TemperatureRelative humidity☂

Is it holiday? ✈ Week of the year Weekday⌚︎

Page 46: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Predictors

TemperatureRelative humidity☂

Is it holiday? ✈ Week of the year Weekday⌚︎

This is the information considered for the predictions.

Page 47: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

Page 48: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

0

10

20

30

90 days of observations

Page 49: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

0

10

20

30

90 days of observations

Page 50: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

0

10

20

30

90 days of observations

Page 51: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

0

10

20

30

90 days of observations

Page 52: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

0

10

20

30

90 days of observations

0

10

20

30

30 days of observations - 1 year before

Page 53: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

0

10

20

30

90 days of observations

0

10

20

30

30 days of observations - 1 year before

Page 54: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

0

10

20

30

90 days of observations

0

10

20

30

30 days of observations - 1 year before+

Page 55: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

0

10

20

30

90 days of observations

0

10

20

30

30 days of observations - 1 year before

0

10

20

30

Next 72 hours

+

Page 56: Predicting occupancy trends in Barcelona's bicycle service stations using open data

3 days of predictions

Using Random Forest

0

10

20

30

90 days of observations

0

10

20

30

30 days of observations - 1 year before

0

10

20

30

Next 72 hours

+

We considered the last 90 days and the 30 days observed 1 year

before to predict the statuses in the next 72 hours.

Page 57: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

Page 58: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

Page 59: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

Page 60: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

Large

improvem

ent

Page 61: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

Large

improvem

ent

In station #124, the use of open data increased 15% of the accuracy.

Page 62: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

Large

improvem

ent

Page 63: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

Page 64: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

No impro

vement

Page 65: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

No impro

vement

In station #50, there was no improvement in the accuracy due to the

use of open data.

Page 66: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

No impro

vement

Page 67: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

Page 68: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

Page 69: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

On different stations

0 %

25 %

50 %

75 %

100 %

Station #50 Station #124 Station #92 Station #305

Without open data Using open data

In three stations, we could observe improvements.

Page 70: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

According to the age of the predictions

0 %

50 %

100 %

0 days old 1 day 2 days

Without open data Using open data

Page 71: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

According to the age of the predictions

0 %

50 %

100 %

0 days old 1 day 2 days

Without open data Using open data

Page 72: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Accuracy

According to the age of the predictions

0 %

50 %

100 %

0 days old 1 day 2 days

Without open data Using open data

We observed that the average accuracy was improved when we used

open data in the predictions.

Page 73: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Sensitivity

Using open dataAccording to the age of the predictions

0 %

25 %

50 %

75 %

100 %

0 days old 1 day 2 days

Page 74: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Sensitivity

Using open dataAccording to the age of the predictions

0 %

25 %

50 %

75 %

100 %

0 days old 1 day 2 days

Page 75: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Sensitivity

Using open dataAccording to the age of the predictions

0 %

25 %

50 %

75 %

100 %

0 days old 1 day 2 days

& Specificity

Page 76: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Sensitivity

Using open dataAccording to the age of the predictions

0 %

25 %

50 %

75 %

100 %

0 days old 1 day 2 days

& Specificity

Page 77: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Sensitivity

Using open dataAccording to the age of the predictions

0 %

25 %

50 %

75 %

100 %

0 days old 1 day 2 days

& Specificity

The sensitivity is the percentage of critical statuses that were

correctly predicted. It was over 75%.

Page 78: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Conclusion

Page 79: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Conclusion

Impact ofexternalfactors

Page 80: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Conclusion

Impact ofexternalfactors

The external factors have an impact in the use of the bicycles and

should not be ignored in the predictions.

Page 81: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Conclusion

Impact ofexternalfactors

Page 82: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Conclusion

Impact ofexternalfactorsCritical

statuses canbe predicted

Page 83: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Conclusion

Impact ofexternalfactorsCritical

statuses canbe predicted

Use of open data

Page 84: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Conclusion

Impact ofexternalfactorsCritical

statuses canbe predicted

Use of open dataThe critical statuses can be predicted with the use of open data.

Page 85: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Future work

Scalability

Page 86: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Future work

Scalability

Other data sources

Page 87: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Future work

Scalability

Other data sources

Our future work involve making the predictions for all 400 stations,

considering other sources of open data.

Page 88: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Future work

Scalability

Other data sources

Page 89: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Future work

Scalability

Other data sources

Smartphone application

Page 90: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Future work

Scalability

Other data sources

Smartphone application

Other applications

Page 91: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Future work

Scalability

Other data sources

Smartphone application

Other applications

We expect that the city council might use the predictions to improve

their schedule to collect the bikes from the full stations.

Page 92: Predicting occupancy trends in Barcelona's bicycle service stations using open data

Gabriel Martins Dias [email protected]

Boris Bellalta, Simon Oechsner

Universitat Pompeu Fabra Barcelona, Spain

Predicting occupancy trends in Barcelona's bicycle service stations using open data

Impact ofexternalfactors

Critical statuses canbe predicted

Use of open data