19
Scalable Prediction Services with R

Building Scalable Prediction Services in R

Embed Size (px)

Citation preview

Page 1: Building Scalable Prediction Services in R

Scalable Prediction Services with R

Page 2: Building Scalable Prediction Services in R

#RstatsNYC @Socure

• Real-time fraud detection service using social and online data.

• Predictive R models.

• Latency SLA with customers.

• Model versioning.

• Zero-downtime updates.

Page 3: Building Scalable Prediction Services in R

#RstatsNYC @Socure

Challenges• R not dev-ops friendly.

• Enterprise prediction services a large commitment.

• Enterprise prediction services offer limited model types.

• Transferability and transparency of models.

• Vendor lock-in.

Page 4: Building Scalable Prediction Services in R

#RstatsNYC @Socure

Solution• Embed R models within dev-op friendly middleware.

• Management, deployment, integration leverages existing dev-op processes.

• Service scaling using established strategies and methods.

Page 5: Building Scalable Prediction Services in R

#RstatsNYC @Socure

<file>gen_20150215.rds

saveRDS()

Page 6: Building Scalable Prediction Services in R

#RstatsNYC @Socure

<model>name = generic version = 20150215

<file>gen_20150215.rds

readRDS()

saveRDS()

Page 7: Building Scalable Prediction Services in R

#RstatsNYC @Socure

Rookhttp://…./model/20150215

<model>name = generic version = 20150215

name version

model 20150215

Model Map

<file>gen_20150215.rds

readRDS()

saveRDS()

Page 8: Building Scalable Prediction Services in R

#RstatsNYC @Socure

Rookhttp://…./model/20150215

<model>name = generic version = 20150215

name version

model 20150215

Model Map

predict()

<file>gen_20150215.rds

readRDS()

saveRDS()

JSON

Page 9: Building Scalable Prediction Services in R

#RstatsNYC @Socure

POST generic/20150215

Rook Rook Rook Rook

fork()

……..

Page 10: Building Scalable Prediction Services in R

#RstatsNYC @Socure

pmml

http://…./generic/20150215

org.jpmml.evaluator ModelEvaluator doPost()

Servlet

evaluate()

unmarshalPMML()pmml.gbm()

Page 11: Building Scalable Prediction Services in R

#RstatsNYC @Socure

ServletServletServletServlet

POST generic/20150215

……..

Page 12: Building Scalable Prediction Services in R

#RstatsNYC @Socure

Virtual Machine

Docker Public Repository ECSElasticBeanStalk

R R RR R R

Page 13: Building Scalable Prediction Services in R

#RstatsNYC @Socure

http://…./generic/20150215

ElasticBeanStalk

Prediction ServicePrediction

ServicePrediction Service

US-EAST-1A

Prediction ServicePrediction

ServicePrediction Service

US-EAST-1A

Prediction ServicePrediction

ServicePrediction Service

US-EAST-1A

Page 14: Building Scalable Prediction Services in R

#RstatsNYC @Socure

Page 15: Building Scalable Prediction Services in R

#RstatsNYC @Socure

Page 16: Building Scalable Prediction Services in R

#RstatsNYC @Socure

Page 17: Building Scalable Prediction Services in R

#RstatsNYC @Socure

Conclusions• Rapid deployment of R models in a scalable robust environment.

• Directly leverage R models developed by data scientists and analysts.

• Apply existing dev-ops processes for testing, monitoring, scaling, alerting of predictive models.

• Possible use of PMML to serialize models in future for compliance.

Page 18: Building Scalable Prediction Services in R

#RstatsNYC @Socure

GitHub

https://github.com/Socure/moduleR

Page 19: Building Scalable Prediction Services in R

#RstatsNYC @Socure

We’re Hiring

http://www.socure.com/hiring

Director of Data Science Senior Data Scientist

Director of Engineering