deploying your predictive models as a service via domino

33
Deploying your Predictive Models as a Service via Domino API Endpoint Jo-fai (Joe) Chow Data Scientist at Domino Data Lab 03/20/2022 1 LondonR

Upload: jo-fai-chow

Post on 15-Aug-2015

5.705 views

Category:

Technology


2 download

TRANSCRIPT

04/15/2023 1LondonR

Deploying your Predictive Models as a Service viaDomino API Endpoint

Jo-fai (Joe) ChowData Scientist at Domino Data Lab

04/15/2023LondonR 2

Agenda• Background• My Domino Experience

o Whyo How• Examples (Iris & Stock Market)

• Conclusions• Q & A

04/15/2023LondonR 3

I LondonR!

All about my PhD projectvery interesting stuff …

04/15/2023LondonR 4

First Collaboration

http://blog.dominoup.com/using-r-h2o-and-domino-for-a-kaggle-competition/

04/15/2023LondonR 5

Recap: what I really do

04/15/2023LondonR 6

Recap: what I really do

Since last talk …

xgboost(…),h2o.deeplearning(…)

04/15/2023LondonR 7

About Domino Data Lab

04/15/2023LondonR 8

Why I use Domino• Data science is complicated.

o Knowing how to fit a model is not enough!o Variety of challenges from data analysis to production.o There is no one-size-fits-all solution.

• I do not have time/skills for every single task.• I can use Domino to fill the gaps.• Focus on understanding problems, improving

models and presenting results.• Speed up analysis in just a few clicks.• More time for family and other stuff.

04/15/2023LondonR 9

How I use Domino• Interface

o Web or R

• Exampleso Hello, World! (Iris)o Stock Market Forecast

• Code Sharing• Try it Yourself

04/15/2023LondonR 10

Web Interface

Control Panel

A List of Runs

Console

04/15/2023LondonR 11

Web Interface

Resource Usage (I found it very useful!)

04/15/2023LondonR 12

R Interface

04/15/2023LondonR 13

R Interface

04/15/2023LondonR 14

“Hello, World!” Example

• Classic dataset - Iris

• Four numeric features / predictors (x)o Sepal Length, Sepal Width, Petal Length and Petal Width

• One categorical target (y)o Three species of Iris – Setosa, Versicolor and Virginica

• Using R to build a simple predictive model

• Saving the model for future use

• Deploying the model as web service

• Automatic version control

04/15/2023LondonR 15

Predictive Model?

y = f( X1, X2, X3, X4)

04/15/2023 16

Upload and Run

https://app.dominoup.com/jofaichow/example_iris

Upload the R script toDomino (Web / R)

Start the Run(Web / R)

04/15/2023LondonR 17

Evaluate and Save

Print “Random Forest”model summary

Model with highest 10-fold cross- validation accuracy(i.e. best parameter setting)

Include statistics for future comparison

Finally, save the modelfor future use

04/15/2023LondonR 18

DeployModel

This script 1) loads the model, 2) takes four numeric inputs (X1, X2, X3 & X4) and then 3) returns a prediction.

04/15/2023LondonR 19

Deploy

Point to that script

Specify the function to call

Publish or unpublish the API

Domino automatically keeps all versions of your API

04/15/2023LondonR 20

How to use the API?

04/15/2023LondonR 21

Python API Example

X1, X2, X3 and X4

The four Iris features:Sepal Length, Sepal Width, Petal Length and Petal Width

04/15/2023LondonR 22

Stock Market Forecast• Historical stock data from Yahoo!• Using R to generate numeric features (x)• Target (y) – Next Trading Day % Change in Closing

Price• Using R to build ensembles for forecast• Configure scheduled runs• Automatic version control• API

04/15/2023LondonR 23

Predictive ModelHistorical stock price data from Yahoo!

x: Multiple Technical Analysis Indicators

y: Next Day % Change in Closing Price

Predictive Model:Ensemble of xgboost modelsFor more info, see app.dominoup.com/jofaichow/example_stock

04/15/2023LondonR 24

Scheduled RunsPoint to the R script

Schedule to run at a certain time every Weekday (more options available)

Re-publish API endpoint so it uses the latest results

Select different hardware tiers

Notify your friends / colleagues / clients

04/15/2023LondonR 25

Results Notification

Summary PDF

04/15/2023LondonR 26

Automatic Version Control

Latest Version One of the Previous Versions(I was experimenting with

ggplot2)

04/15/2023LondonR 27

Stock API Endpoint

Stock Symbol (Ticker) for Query

04/15/2023LondonR 28

Code Sharing

Control Panel Settings One Click

04/15/2023LondonR 29

Try it YourselfRegister at www.dominodatalab.com

Help, Quick Start, Forum at support.dominodatalab.com

04/15/2023LondonR 30

Try it YourselfGo to https://app.dominoup.com/jofaichow/example_iris

04/15/2023LondonR 31

Set up your first API Endpoint in Minutes

Point it to your own projectInsert your own API key

04/15/2023LondonR 32

Conclusions• Data science is complicated.• Our time is important.• I can use Domino to save time.• It helps me to tackle some

challenges that are outside my comfort zone.

04/15/2023LondonR 33

Thanks!• Mango Solutions• My Colleagues at Domino• More Info and Feedback

o [email protected] Twitter: @matlabulouso http://blog.dominodatalab.com/

• Codeo Iris Example –

https://app.dominoup.com/jofaichow/example_iriso Stock Example – https://

app.dominoup.com/jofaichow/example_stock