Implementing a Predictive Analytics model - · PDF filePMML description Caché can...
Transcript of Implementing a Predictive Analytics model - · PDF filePMML description Caché can...
![Page 1: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/1.jpg)
Cache C o n f
CacheConf
Implementing a Predictive Model
Danny Wijnschenk
Sales Engineer
![Page 2: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/2.jpg)
Cache C o n f
Data Analytics
Descriptive
Analytics
What?
now
Predictive
Analytics
What?
Prescriptive
Analytics
Why?
![Page 3: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/3.jpg)
Cache C o n f
Weather
Examples of Predictive Analytics
![Page 4: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/4.jpg)
Cache C o n f
Retail
Examples of Predictive Analytics
![Page 5: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/5.jpg)
Cache C o n f
Energy Smart Meters
Examples of Predictive Analytics
![Page 6: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/6.jpg)
Cache C o n f
Building Predictive Models
![Page 7: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/7.jpg)
Cache C o n f
Get the historical data
External data needed ?
Look for dependencies
(Overfitting)
Building Predictive Models
Explore
![Page 8: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/8.jpg)
Cache C o n f
Empty fields
Wrong data
Formats
Building Predictive Models
Clean
![Page 9: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/9.jpg)
Cache C o n f
Divide data in training and
testing set
Choose model
Train the model with training
set
Building Predictive Models
Train
![Page 10: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/10.jpg)
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
![Page 11: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/11.jpg)
Cache C o n f
Data Scientists
![Page 12: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/12.jpg)
Cache C o n f
Production Environment
![Page 13: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/13.jpg)
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
![Page 14: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/14.jpg)
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é
![Page 15: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/15.jpg)
Cache C o n f
Demo
![Page 16: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/16.jpg)
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
![Page 17: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/17.jpg)
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
![Page 18: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/18.jpg)
Cache C o n f
Step 1 : Database Reader
![Page 19: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/19.jpg)
Cache C o n f
Step 2 : Column Filter
![Page 20: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/20.jpg)
Cache C o n f
Step 3 : Decision Tree Learner
![Page 21: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/21.jpg)
Cache C o n f
Step 4 : View Result
![Page 22: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/22.jpg)
Cache C o n f
Step 4 : Example of Overfitting
![Page 23: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/23.jpg)
Cache C o n f
Step 5 : Export PMML
![Page 24: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/24.jpg)
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
![Page 25: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/25.jpg)
Cache C o n f
Step 1 : Database Reader
![Page 26: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/26.jpg)
Cache C o n f
Step 2 : Cleanup the Data
![Page 27: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/27.jpg)
Cache C o n f
Step 3 : Polynomial Regression Learner
![Page 28: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/28.jpg)
Cache C o n f
Step 4 : View Result
![Page 29: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/29.jpg)
Cache C o n f
Step 5 : Export PMML
![Page 30: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/30.jpg)
Cache C o n f
Import PMML in Caché Class
![Page 31: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/31.jpg)
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
![Page 32: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/32.jpg)
Cache C o n f
Run model in Caché SQL
![Page 33: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/33.jpg)
Cache C o n f
Run model from any UI (e.g. AngularJS)
![Page 34: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/34.jpg)
Cache C o n f
Test model in DeepSee
![Page 35: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/35.jpg)
Cache C o n f
Run model in DeepSee
![Page 36: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/36.jpg)
Cache C o n f
Run model in DeepSee
![Page 37: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/37.jpg)
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
![Page 38: Implementing a Predictive Analytics model - · PDF filePMML description Caché can deploy a Predictive Model by using the PMML description An Application Developer can run the model](https://reader031.fdocuments.in/reader031/viewer/2022030414/5a9f95fa7f8b9a84178d0939/html5/thumbnails/38.jpg)
Cache C o n f
Questions?