collecting uncertain data the reactive way

69
Collecting Uncertain Data the Reactive Way Jeff Smith @jeffksmithjr

Upload: jeff-smith

Post on 15-Apr-2017

22.925 views

Category:

Data & Analytics


1 download

TRANSCRIPT

Page 1: Collecting Uncertain Data the Reactive Way

Collecting Uncertain Data the Reactive Way

Jeff Smith @jeffksmithjr

Page 2: Collecting Uncertain Data the Reactive Way

x.ai is a personal assistant who schedules meetings for you

Page 3: Collecting Uncertain Data the Reactive Way
Page 4: Collecting Uncertain Data the Reactive Way

Reactive Machine Learning

Page 5: Collecting Uncertain Data the Reactive Way
Page 6: Collecting Uncertain Data the Reactive Way
Page 7: Collecting Uncertain Data the Reactive Way
Page 8: Collecting Uncertain Data the Reactive Way

Machine Learning Systems

Page 9: Collecting Uncertain Data the Reactive Way

Machine Learning Systems

Page 10: Collecting Uncertain Data the Reactive Way

Machine Learning Systems

Page 11: Collecting Uncertain Data the Reactive Way

Traits of Reactive Systems

Page 12: Collecting Uncertain Data the Reactive Way

Traits of Reactive Systems

Page 13: Collecting Uncertain Data the Reactive Way

Reactive Strategies

Page 14: Collecting Uncertain Data the Reactive Way

Reactive Strategies

Page 15: Collecting Uncertain Data the Reactive Way

Reactive Machine Learning

Page 16: Collecting Uncertain Data the Reactive Way

Reactive Machine Learning

Page 17: Collecting Uncertain Data the Reactive Way

Reactive Machine Learning

Page 18: Collecting Uncertain Data the Reactive Way

Collecting Data

Page 19: Collecting Uncertain Data the Reactive Way
Page 20: Collecting Uncertain Data the Reactive Way
Page 21: Collecting Uncertain Data the Reactive Way
Page 22: Collecting Uncertain Data the Reactive Way

What’s for dinner?

Page 23: Collecting Uncertain Data the Reactive Way
Page 24: Collecting Uncertain Data the Reactive Way
Page 25: Collecting Uncertain Data the Reactive Way
Page 26: Collecting Uncertain Data the Reactive Way
Page 27: Collecting Uncertain Data the Reactive Way
Page 28: Collecting Uncertain Data the Reactive Way
Page 29: Collecting Uncertain Data the Reactive Way

Reactive Data Collection

Page 30: Collecting Uncertain Data the Reactive Way

Modeling Uncertain Data

Page 31: Collecting Uncertain Data the Reactive Way

Certain Data Model

case class ZebraReading(sensorId: Int, locationId: Int, timestamp: Long, count: Int)

Page 32: Collecting Uncertain Data the Reactive Way
Page 33: Collecting Uncertain Data the Reactive Way

Uncertainty Interval

27 33

Page 34: Collecting Uncertain Data the Reactive Way

Uncertain Data Model

case class PreyReading(sensorId: Int, locationId: Int, timestamp: Long, animalsLowerBound: Double, animalsUpperBound: Double, percentZebras: Double)

Page 35: Collecting Uncertain Data the Reactive Way

Scaling Data Collection

Page 36: Collecting Uncertain Data the Reactive Way
Page 37: Collecting Uncertain Data the Reactive Way

Simple Data Architecture

Page 38: Collecting Uncertain Data the Reactive Way

Simple Data Architecture

Page 39: Collecting Uncertain Data the Reactive Way

Mutable State

case class Region(id: Int)

import collection.mutable.HashMap var densities = new HashMap[Region, Double]()

densities.put(Region(4), 52.4)

Page 40: Collecting Uncertain Data the Reactive Way

Scaling with Queues

Page 41: Collecting Uncertain Data the Reactive Way

Scaling with Queues

Page 42: Collecting Uncertain Data the Reactive Way

Out of Order Updates

Page 43: Collecting Uncertain Data the Reactive Way

Out of Order Updates

densities.put(Region(6), 73.6) densities.put(Region(6), 0.5) densities.get(Region(6)).get

Page 44: Collecting Uncertain Data the Reactive Way

Out of Order Updates

densities.put(Region(6), 73.6) densities.put(Region(6), 0.5) densities.get(Region(6)).get

densities.put(Region(6), 0.5) densities.put(Region(6), 73.6) densities.get(Region(6)).get

Page 45: Collecting Uncertain Data the Reactive Way

Concurrent Collections

import collection.mutable._

var synchronizedDensities = new LinkedHashMap[Region, Double]() with SynchronizedMap[Region, Double]

Page 46: Collecting Uncertain Data the Reactive Way

Scaling with Locks

Page 47: Collecting Uncertain Data the Reactive Way

Scaling with Locks

Page 48: Collecting Uncertain Data the Reactive Way

Immutable Factscase class PreyReading(sensorId: Int, locationId: Int, timestamp: Long, animalsLowerBound: Double, animalsUpperBound: Double, percentZebras: Double)

implicit val preyReadingFormatter = Json.format[PreyReading]

Page 49: Collecting Uncertain Data the Reactive Way

Immutable Factsval reading = PreyReading(36, 12, currentTimeMillis(), 12.0, 18.0, 0.60)

val setDoc = bucket.set[PreyReading](readingId(reading), reading)

Page 50: Collecting Uncertain Data the Reactive Way

Scaling with Distributed Databases

Page 51: Collecting Uncertain Data the Reactive Way

Scaling with Distributed Databases

Page 52: Collecting Uncertain Data the Reactive Way

Handling Incomplete Data

Page 53: Collecting Uncertain Data the Reactive Way

Distributed Data Storage

Page 54: Collecting Uncertain Data the Reactive Way

Querying Complete Data

(bucket.searchValues[PreyReading]("prey", "by_sensor_id") (new Query().setIncludeDocs(true))) .enumerate.apply(Iteratee.foreach { doc => println(s"Prey Reading: $doc")})

Page 55: Collecting Uncertain Data the Reactive Way

Complete Data

Page 56: Collecting Uncertain Data the Reactive Way

Partition Tolerance

Page 57: Collecting Uncertain Data the Reactive Way

Partition Tolerance

Page 58: Collecting Uncertain Data the Reactive Way

Partition Tolerance

Page 59: Collecting Uncertain Data the Reactive Way

Partition Tolerance

Page 60: Collecting Uncertain Data the Reactive Way

Querying Incomplete Data

(bucket.searchValues[PreyReading]("prey", "by_sensor_id") (new Query().setIncludeDocs(true))) .enumerate.apply(Iteratee.foreach { doc => println(s"Prey Reading: $doc")})

Page 61: Collecting Uncertain Data the Reactive Way

Incomplete Data

Page 62: Collecting Uncertain Data the Reactive Way

Incomplete Data

Page 63: Collecting Uncertain Data the Reactive Way

Reactive Data Collection

Page 64: Collecting Uncertain Data the Reactive Way

For Later

Page 65: Collecting Uncertain Data the Reactive Way

reactivemachinelearning.com medium.com/data-engineering

M A N N I N G

Jeff Smith

Page 66: Collecting Uncertain Data the Reactive Way

x.ai @xdotai [email protected] New York, New York

Page 67: Collecting Uncertain Data the Reactive Way

skillsmatter.com/conferences/ 6862-scala-exchange-2015#skillscasts

Page 68: Collecting Uncertain Data the Reactive Way

Thank You

Page 69: Collecting Uncertain Data the Reactive Way

Collecting Uncertain Data the Reactive Way

Jeff Smith @jeffksmithjr