Salome HOME
pmml doc
authorlhelgoualch <lhelgoualch>
Fri, 20 Dec 2013 15:57:01 +0000 (15:57 +0000)
committerlhelgoualch <lhelgoualch>
Fri, 20 Dec 2013 15:57:01 +0000 (15:57 +0000)
doc/CMakeLists.txt
doc/Doxyfile.in
doc/images/pmml_exec.png [new file with mode: 0644]
doc/pmml.rst [new file with mode: 0644]
doc/using.rst
src/pmml/doc/doxygen/CMakeLists.txt

index 99f781e13ca41ee5ad9c4a97eca82718681e2ec1..765d23d73fe976a0974d63081c023d283f3f5cc6 100644 (file)
@@ -48,6 +48,7 @@ SET(RSTFILES
   main_menu.rst
   modification.rst
   operations.rst
+  pmml.rst
   principes.rst
   progdsc.rst
   pysalome.rst
index 097d16d636c471b83511d832dee7e0857ec791b6..c27fd0ba2d07347ed49998bf7960167b9f6802a2 100644 (file)
@@ -113,7 +113,8 @@ INPUT                  =  \
    @CMAKE_SOURCE_DIR@/src/genericgui \
    @CMAKE_SOURCE_DIR@/src/salomegui \
    @CMAKE_SOURCE_DIR@/src/salomewrap \
-   @CMAKE_SOURCE_DIR@/src/pyqt
+   @CMAKE_SOURCE_DIR@/src/pyqt \
+   @CMAKE_SOURCE_DIR@/src/pmml
 
 FILE_PATTERNS          = *.c \
                          *.cc \
diff --git a/doc/images/pmml_exec.png b/doc/images/pmml_exec.png
new file mode 100644 (file)
index 0000000..8593f41
Binary files /dev/null and b/doc/images/pmml_exec.png differ
diff --git a/doc/pmml.rst b/doc/pmml.rst
new file mode 100644 (file)
index 0000000..8ce8c85
--- /dev/null
@@ -0,0 +1,94 @@
+.. _pmml:
+
+*******************************************************
+Loading and executing a PMML file
+*******************************************************
+
+The Predictive Model Markup Language (PMML) is an XML-based file format developed by the Data Mining Group 
+to provide a way for applications to describe and exchange models produced by data mining and machine learning 
+algorithms.
+
+Yacs provides an elementary python node called **PyLoadPMML** that generates an object of type **pyobj** 
+from a model read in a PMML file.
+This pyobj is a **PyFunction** that can be executed in a python node created by the user.
+
+
+.. _pmmlModelTypes:
+
+Authorized PMML model types
+===================================
+
+Node PyLoadPMML uses the swig/python interface to library libpmmlLib.so (Linux) or pmmllib.dll (Windows). 
+This library handles :
+   - **Neuronal Network** models and
+   - **Linear Regression** models.
+
+.. _pmmlPyLoadPMML:
+
+Description of PyLoadPMML
+===================================
+
+
+   - **Input ports** 
+
+================= ================= ========================================
+Input port name     YACS type         Comment
+================= ================= ========================================
+filename            string            Name of the PMML file, 
+                                      including its path if the file is 
+                                      not in the current directory
+
+modelname           string            Name of the model to load
+
+pmmltype            string            Type of the model. Value is one of 
+                                      kLR (linear regression) 
+                                      or kANN (neural network)
+================= ================= ========================================
+
+
+
+   - **Output ports** 
+
+================= ================= ========================================
+Output port name    YACS type         Comment
+================= ================= ========================================
+pyFunc              pyobj             PyFunction representing the model 
+                                      This function takes a vector of
+                                      doubles as input parameter and
+                                      returns a value of type double
+================= ================= ========================================
+
+
+.. _pmmlModelExecution:
+
+Example of model execution
+===================================
+
+Create a YACS schema that uses node PyLoadPMML and add a python node that will execute the 
+the pyfunction created by PyLoadPMML. The YACS schema with the execution python node code 
+is shown below : 
+
+.. image:: images/pmml_exec.png
+  :align: center
+
+The characteristics of the execution node are the following:
+
+   - **Input ports** 
+
+================= ================= ========================================
+Input port name     YACS type         Comment
+================= ================= ========================================
+myFunc              pyobj             Linked to the PyFunction generated 
+                                      by PyLoadPMML 
+
+params              dblevec           Vector of doubles,
+                                      input of the PyFunction
+================= ================= ========================================
+
+   - **Output ports** 
+
+================= ================= ========================================
+Output port name    YACS type         Comment
+================= ================= ========================================
+o5                  double            Result of the model execution 
+================= ================= ========================================
index 334478021da107c273e3877d1a6f4cb42483822f..d0c1fb7f6ede3ffd93067286589d50cf1f9a1c23 100644 (file)
@@ -63,4 +63,5 @@ generates the necessary SALOME embedment starting from a brief description of th
    batch
    optimizer
    resource
+   pmml
 
index 9540d836595c3d4d935ce94d6cb59490e67f20e5..018d97dc5b39bcc98d294cd9820979f254bd794f 100755 (executable)
@@ -37,7 +37,6 @@ FILE(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}" output)
 # Here is the "standard" procedure, as if ${input} was hand-written.
 ADD_CUSTOM_TARGET(usr_docs ALL
   COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile_pmml_user
-  COMMAND ${PYTHON_EXECUTABLE} -c "import shutil, sys; shutil.rmtree(r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/PMML''', True); shutil.copytree(r'''${CMAKE_CURRENT_BINARY_DIR}/doc_ref_user/html''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/PMML'''); shutil.copy(r'''${CMAKE_CURRENT_SOURCE_DIR}/images/head.png''', r'''${CMAKE_INSTALL_PREFIX}/share/doc/salome/PMML''')"
   VERBATIM
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
   )