Top Banner
Mobility Insights at Swisscom : Understanding Collective Mobility in Switzerland Spark Summit, October 2016 [email protected] @huitseeker [email protected] @mou7
36

Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Feb 15, 2017

Download

Technology

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Mobility Insights at Swisscom :Understanding Collective Mobility

in SwitzerlandSpark Summit, October 2016

[email protected] @[email protected] @mou7

Page 2: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

AgendaIntroSmart-DataBig Data ArchitectureTrajectory ClassificationStreamingData challenges

Page 3: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Introduction : Positioning

Page 4: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Positioning users in a modernnetwork

no triangulation at scalepositioning based on cell attachement history, prec ~200mcell-to-cell handover, prec ~50m around limitTiming Advance (roundtrip) : better results on good data sources

Page 5: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Trajectory datamining

time series reconstructiontrajectory segmentationmap matching, clusteringmode of transport detection...

Page 6: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

How to create value withpositioning at Swisscom ?

with competitive analytics & data sources,and by making sure it embodies the right values.

Page 7: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Smart Data

Page 8: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

On (not) tracking (any users)"Swisscom strictly complies with all applicable legislations, inparticular with the telecommunications law and the dataprotection initiative."

Jürg Studerus, Swisscom Senior Manager, Corporate Responsibility

Page 9: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Smart Data : Big Data without Big BrotherPrivacy preservation is an assetIt makes sense to care as much about your customer as they do about you.

We technically enforce thisanswering only synoptic questions, no individual ones,with data flow control : we neutralize quasi-identifiers at every stage

Page 10: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Swisscom mobile subscribers

source: xavierstuder.com, MD&A reports

Page 11: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Our choicespublic good applications: making Switzerland run better,understanding places, not individuals,anonymized aggregations

Page 12: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

A first product : City

"It's a dream for civil engineers" -- Alexandre Machu, Urbansystems engineer, Pully

Page 13: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Demo time

Page 14: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

UsagesNew roads to divert transit traffic out of downtown (informs a 50M$project)Parking lot expansion and transformation (informs a 10M$ project)Electric car charging station deployment

Page 15: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Big Data architecture

Page 16: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

In the backend

Page 17: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Spark configuration essentials for enterprisejobs

spark.executor.memory="not the default 1g" spark.kryo.registrator="something custom" // among others spark.shuffle.service.enabled="true" spark.dynamicAllocation.enabled="true" spark.deploy.recoveryMode="ZOOKEEPER" spark.deploy.recoveryDirectory="/path/to/state" spark.deploy.zookeeper.url="quorumMachine1:2181, ..."

NOT the only valuable settings, seehttps://techsuppdiva.github.io

Page 18: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Scala (1/2)type ChronoHistory = List[UEupdate] @@ Chronological type AnteChronoHistory = List[UEupdate] @@ AnteChronological implicit class Chrono(l: List[UEupdate]) { def asChrono: ChronoHistory = { chronoCheck(l) l.asInstanceOf[ChronoHistory] } def asAnteChrono: AnteChronoHistory = { anteChronoCheck(l) l.asInstanceOf[AnteChronoHistory] } }

Page 19: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Scala (2/2)implicit def reverseChrono(l: ChronoHistory): AnteChronoHistory = l.reverse.asAnteChronoimplicit def reverseAnteChrono(l: AnteChronoHistory): ChronoHistory = l.reverse.asChrono

Page 20: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

>

Trajectory Classification

Page 21: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

What is the proportion of tripsassociated with trains?

Page 22: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Mode of Transport DetectionInput: Sequence of network eventsOutput: Mode of transport (train vs. other)Network events associated with cellsCreate fingerprints of cellsIntuition: cells with intermittent increases in the number of connections areassociated with collective mode of transports

Page 23: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Bursty Cell

Number of devices vs. minute of day

Page 24: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

BurstinessRandom process with mean and variance , the relative variance isμ σ2

.D = σ2

μ

Page 25: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Machine Learning with SparkPeriodic Spark job to compute cell featuresSupervised training on labeled data (train vs. others)Training and test with Spark ML

Page 26: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Spark (1/2)val labeledPoints: RDD[LabeledPoint] = data.map { case (transportMode, tripFeatures) => LabeledPoint( labelOf(transportMode).toDouble, featuresToFeatureVector(tripFeatures) ) } // generate labeled data labeledPoints.cache() def trainNewModel = // Fix the used model new LogisticRegressionWithLBFGS() .setIntercept(true) .setNumClasses(numberOfClasses) .run(_: RDD[LabeledPoint])

Page 27: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Spark (2/2)// train a model for performance evaluation val model = trainNewModel(trainingData) // Evaluate model on test instances and compute test error val labelAndPreds = testData.map { point => val prediction = model.predict(point.features) (point.label, prediction) } val testErr = (labelAndPreds .filter(r => r._1 != r._2) .count().toDouble) / testData.count() // train final model on the whole dataset val finalModel = trainNewModel(labeledPoints)

Page 28: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Streaming Analytics

Page 29: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Road conditions on highways

Page 30: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Selecting users on a path of Interest

Page 31: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Graph matchingLocality-sensitive hashing :

A family H of hashing functions is -sensitive if:

if then

if then

More:

Locality Sensitive Hashing By Spark, Uber, Spark Summit2016A Gentle Introduction to Locality-Sensitive Hashing withApache Spark, Scala By The Bay 2015

(r, cr, , )p1 p2

p– q ≤ rP [h(q) = h(p)] ≥rH p1

p– q ≥ crP [h(q) = h(p)] ≤rH p2

Page 32: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Computing speeds: Solving graphconstraints

given a history of cells, where was the user, exactly ? (twice)what's the path between 2 positions ?linear query per user

Page 33: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Checkpointing: Set the checkpointinterval

are you checkpointing too often ?every batches, you'll need batches to recover from checkpointing timelossmake sure

k p

k ≥ p

Page 34: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Data Challenges

Page 35: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Crucial elementsQuality, reliability of data sourcesAutomated ground truth checking

sensorsTEMS fleet

What's the ground truth for mode of transport, domicile, etc ?Colleagues and friends volunteers

Page 36: Mobility insights at Swisscom - Understanding collective mobility in Switzerland

Questions ?