Cache C o n f
CacheConf
Implementing a Predictive Model
Danny Wijnschenk
Sales Engineer
Cache C o n f
Data Analytics
Descriptive
Analytics
What?
now
Predictive
Analytics
What?
Prescriptive
Analytics
Why?
Cache C o n f
Weather
Examples of Predictive Analytics
Cache C o n f
Retail
Examples of Predictive Analytics
Cache C o n f
Energy Smart Meters
Examples of Predictive Analytics
Cache C o n f
Building Predictive Models
Cache C o n f
Get the historical data
External data needed ?
Look for dependencies
(Overfitting)
Building Predictive Models
Explore
Cache C o n f
Empty fields
Wrong data
Formats
Building Predictive Models
Clean
Cache C o n f
Divide data in training and
testing set
Choose model
Train the model with training
set
Building Predictive Models
Train
Cache C o n f
Use test set to verify results
Go back to Explore-Clean-
Train till metrics are OK
Building Predictive Models
Test
Cache C o n f
Data Scientists
Cache C o n f
Production Environment
Cache C o n f
Predictive Model Markup Language
XML based file format
Supported by major modelling tools
(SPSS, SAS, R, Knime, MicroStrategy, …)
Connects the Data Scientists World to the
Production World
PMML
Cache C o n f
Insert PMML in a class or use Wizard
Compile
Run In Caché Object Script
In DeepSee (as Dimension, Calculated Measure, KPI)
In Caché SQL
Deploy a Predictive Model in Caché
Cache C o n f
Demo
Cache C o n f
Show how to build a Predictive Model Using Knime (www.knime.org)
Open Source
User Friendly UI
Export the model in PMML
Import PMML in Caché
Use the model in Caché (COS, SQL,
DeepSee)
Steps of the Demo
Cache C o n f
Create model based on Decision Tree
Car data contains Brand, Model, Year of car
Number of Cylinders of engine
Weight of the car
Engine Horsepower
Displacement of Cylinders
Consumption in Miles per Gallon
Origin should be Japan, US or Europe
Case 1 : Predicting the Origin of Cars
Cache C o n f
Step 1 : Database Reader
Cache C o n f
Step 2 : Column Filter
Cache C o n f
Step 3 : Decision Tree Learner
Cache C o n f
Step 4 : View Result
Cache C o n f
Step 4 : Example of Overfitting
Cache C o n f
Step 5 : Export PMML
Cache C o n f
Create model based on Polynomial
Regression
Car data contains Brand, Model, Year, Origin of car
Number of Cylinders of engine
Weight of the car
Engine Horsepower
Displacement of Cylinders
Consumption in Miles per Gallon
Case 2 : Predicting Car Consumption
Cache C o n f
Step 1 : Database Reader
Cache C o n f
Step 2 : Cleanup the Data
Cache C o n f
Step 3 : Polynomial Regression Learner
Cache C o n f
Step 4 : View Result
Cache C o n f
Step 5 : Export PMML
Cache C o n f
Import PMML in Caché Class
Cache C o n f
Do ##class(PredictiveAnalytics.
ModelOrigin).%GetModelInstance(, .model)
Set data("Acceleration") = 12
Set data("MilesPerGallon") = 20
Set data("Weight") = 2400
Set data("Horsepower") = 146
Do model.%ExecuteModel(.data, .output)
Write output.Origin
Run model in Caché Object Script
Cache C o n f
Run model in Caché SQL
Cache C o n f
Run model from any UI (e.g. AngularJS)
Cache C o n f
Test model in DeepSee
Cache C o n f
Run model in DeepSee
Cache C o n f
Run model in DeepSee
Cache C o n f
Data Scientists make Predictive Models
with specialized tools
Predictive Models can be exported in a
PMML description
Caché can deploy a Predictive Model by
using the PMML description
An Application Developer can run the
model anywhere in Caché (COS, SQL,
DeepSee)
TakeAway Summary
Cache C o n f
Questions?