3 *******************************************************
4 Loading and executing a PMML file
5 *******************************************************
7 The Predictive Model Markup Language (PMML) is an XML-based file format developed by the Data Mining Group
8 to provide a way for applications to describe and exchange models produced by data mining and machine learning
11 Yacs provides an elementary python node called **PyLoadPMML** that generates an object of type **pyobj**
12 from a model read in a PMML file.
13 This pyobj is a **PyFunction** that can be executed in a python node created by the user.
18 Authorized PMML model types
19 ===================================
21 Node PyLoadPMML uses the swig/python interface to library libpmmlLib.so (Linux) or pmmllib.dll (Windows).
22 This library handles :
23 - **Neuronal Network** models and
24 - **Linear Regression** models.
28 Description of PyLoadPMML
29 ===================================
34 ================= ================= ========================================
35 Input port name YACS type Comment
36 ================= ================= ========================================
37 filename string Name of the PMML file,
38 including its path if the file is
39 not in the current directory
41 modelname string Name of the model to load
43 pmmltype string Type of the model. Value is one of
44 kLR (linear regression)
45 or kANN (neural network)
46 ================= ================= ========================================
52 ================= ================= ========================================
53 Output port name YACS type Comment
54 ================= ================= ========================================
55 pyFunc pyobj PyFunction representing the model
56 This function takes a vector of
57 doubles as input parameter and
58 returns a value of type double
59 ================= ================= ========================================
62 .. _pmmlModelExecution:
64 Example of model execution
65 ===================================
67 Create a YACS schema that uses node PyLoadPMML and add a python node that will execute the
68 the pyfunction created by PyLoadPMML. The YACS schema with the execution python node code
71 .. image:: images/pmml_exec.png
74 The characteristics of the execution node are the following:
78 ================= ================= ========================================
79 Input port name YACS type Comment
80 ================= ================= ========================================
81 myFunc pyobj Linked to the PyFunction generated
84 params dblevec Vector of doubles,
85 input of the PyFunction
86 ================= ================= ========================================
90 ================= ================= ========================================
91 Output port name YACS type Comment
92 ================= ================= ========================================
93 o5 double Result of the model execution
94 ================= ================= ========================================