A short presentation and then a demo:
- About Us
- Intro
- The Problem: Operationalizing Predictive Models
- Solutions
- Case Study: Iris Flower Predictor
- Demo
- Q & A
October 01, 2015
A short presentation and then a demo:
Common examples of data driven products:
library(xtable) data(iris) print(xtable(head(iris, 5)), type = "html", include.rownames = F)
| Sepal.Length | Sepal.Width | Petal.Length | Petal.Width | Species |
|---|---|---|---|---|
| 5.10 | 3.50 | 1.40 | 0.20 | setosa |
| 4.90 | 3.00 | 1.40 | 0.20 | setosa |
| 4.70 | 3.20 | 1.30 | 0.20 | setosa |
| 4.60 | 3.10 | 1.50 | 0.20 | setosa |
| 5.00 | 3.60 | 1.40 | 0.20 | setosa |
Web Sample http://bit.ly/1YPQFJu hosted on heroku
or run it yourself Github http://github.com/yxes/domino_iris
Web Sample
- Fill out the input form with input values and click "make prediction".
- The predicted value (Species type) is displayed in the web app.
MODEL_ATTRS = [ 'sepal_length', 'sepal_width',
'petal_length', 'petal_width' ]
if request.method == 'POST': # you submitted the form
attributes = [] # just the values from the form in an array
for field in MODEL_ATTRS:
attributes.append(request.form[field])
result = fetch_score(attributes)
result = result.json()
API_KEY = 'YOUR_API_KEY'
def fetch_score(attributes):
return requests.post(
"https://app.dominodatalab.com/v1/SparkIQLabs/helloWorld/endpoint",
headers = {
'X-Domino-Api-Key': API_KEY,
'Content-type': 'application/json'
},
json={ "parameters": attributes }
)