"Install path: SALOME Python shared modules")
ENDIF(SALOME_YACS_USE_SWIG)
-SET(SALOME_INSTALL_RES share/salome/resources CACHE PATH "Install path: SALOME resources")
SET(SALOME_PMML_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/pmml" CACHE PATH "Install path: SALOME PMML specific data")
# Sources
PMMLlib.cxx
)
-ADD_SUBDIRECTORY(resources)
-
ADD_LIBRARY(pmmlLib SHARED ${pmml_SOURCES})
TARGET_LINK_LIBRARIES(pmmlLib ${LIBXML2_LIBRARIES} )
INSTALL(TARGETS pmmlLib EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
ADD_TEST(TestPMML TestPMML)
+FILE(COPY ${PROJECT_SOURCE_DIR}/src/pmml/Test/samples DESTINATION . )
INSTALL(TARGETS TestPMML DESTINATION ${SALOME_INSTALL_BINS})
void PMMLBasicsTest1::setUp()
{
+ resourcesDir = "samples/";
#ifdef WIN32
- const char* p = std::getenv("YACS_ROOT_DIR");
- std::string strP("");
- if (p)
- strP = std::string(p);
- else
- throw std::string("unable to get YACS_ROOT_DIR");
- resourcesDir = strP;
- resourcesDir += "/share/salome/resources/pmml/";
const char* user = std::getenv("USERPROFILE");
std::string strUser("");
- if (user)
+ if (user)
strUser = std::string(user);
- else
+ else
throw std::string("unable to get USERPROFILE");
tmpDir = strUser;
tmpDir += "\\tmp";
std::string cmd = "mkdir " + tmpDir;
system( cmd.c_str() );
#else
- resourcesDir = getenv("YACS_ROOT_DIR");
- resourcesDir += "/share/salome/resources/pmml/";
tmpDir = "/tmp/";
tmpDir += getenv("USER");
tmpDir += "/PmmlUnitTest/";
std::string cmd = "mkdir -p " + tmpDir;
system( cmd.c_str() );
-#endif
+#endif
}
void PMMLBasicsTest1::tearDown()
--- /dev/null
+# Copyright (C) 2012-2014 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+SET(PMML_RESOURCES_FILES
+ # ici les noms des fichiers ressources
+ ann_model.pmml
+ ann_model_2.pmml
+ lr_model.pmml
+ lr_model_2.pmml
+ no_model.pmml
+ two_models_ann_lr.pmml
+ unittest_ref_ann_model.cpp
+ unittest_ref_ann_model.f
+ unittest_ref_ann_model.py
+ unittest_ref_lr_model.cpp
+ unittest_ref_lr_model.f
+ unittest_ref_lr_model.py
+ win32_ann_model.pmml
+ win32_lr_model.pmml
+ )
+
+INSTALL(FILES ${PMML_RESOURCES_FILES} DESTINATION ${SALOME_PMML_INSTALL_RES_DATA})
+
+# MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml")
+# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/PMMLCatalog.xml.in ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml @ONLY)
+# MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml")
+# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml @ONLY)
+
+# INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml DESTINATION ${SALOME_PMML_INSTALL_RES_DATA})
--- /dev/null
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+ <Header copyright="myCopyright" description="Tests unitaires">
+ <Application name="PMMLlib" version="myVersion"/>
+ <Annotation>Tests unitaires PMMLlib</Annotation>
+ </Header>
+ <DataDictionary>
+ <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+ <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+ <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+ <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+ <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+ <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+ <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+ <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+ <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+ </DataDictionary>
+ <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
+ <MiningSchema>
+ <MiningField name="rw" usageType="active"/>
+ <MiningField name="r" usageType="active"/>
+ <MiningField name="tu" usageType="active"/>
+ <MiningField name="tl" usageType="active"/>
+ <MiningField name="hu" usageType="active"/>
+ <MiningField name="hl" usageType="active"/>
+ <MiningField name="l" usageType="active"/>
+ <MiningField name="kw" usageType="active"/>
+ <MiningField name="yhat" usageType="predicted"/>
+ </MiningSchema>
+ <NeuralInputs numberOfInputs="8">
+ <NeuralInput id="0">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="rw">
+ <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
+ <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="1">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="r">
+ <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
+ <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="2">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tu">
+ <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
+ <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="3">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tl">
+ <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
+ <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="4">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hu">
+ <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
+ <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="5">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hl">
+ <LinearNorm orig="0.000000e+00" norm="-4.562070e-02"/>
+ <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="6">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="l">
+ <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
+ <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="7">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="kw">
+ <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
+ <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ </NeuralInputs>
+ <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+ <Neuron id="8" bias="-1.263572e+00">
+ <Con from="0" weight="7.536629e-01"/>
+ <Con from="1" weight="1.653660e-03"/>
+ <Con from="2" weight="4.725001e-03"/>
+ <Con from="3" weight="9.969786e-03"/>
+ <Con from="4" weight="1.787976e-01"/>
+ <Con from="5" weight="-1.809809e-01"/>
+ <Con from="6" weight="-1.735688e-01"/>
+ <Con from="7" weight="8.559675e-02"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+ <Neuron id="9" bias="-1.745483e+00">
+ <Con from="8" weight="6.965512e+00"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralOutputs numberOfOutputs="1">
+ <NeuralOutput outputNeuron="9">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="yhat">
+ <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
+ <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralOutput>
+ </NeuralOutputs>
+ </NeuralNetwork>
+</PMML>
--- /dev/null
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-3_0" version="3.0">
+ <Header copyright="texte copyright" description="texte description">
+ <Application name="Uranie" version="2.3/1"/>
+ <Annotation>date Fri Oct 07, 2011</Annotation>
+ </Header>
+ <DataDictionary>
+ <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+ <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+ <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+ <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+ <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+ <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+ <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+ <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+ <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+ </DataDictionary>
+ <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
+ <MiningSchema>
+ <MiningField name="rw" usageType="active"/>
+ <MiningField name="r" usageType="active"/>
+ <MiningField name="tu" usageType="active"/>
+ <MiningField name="tl" usageType="active"/>
+ <MiningField name="hu" usageType="active"/>
+ <MiningField name="hl" usageType="active"/>
+ <MiningField name="l" usageType="active"/>
+ <MiningField name="kw" usageType="active"/>
+ <MiningField name="yhat" usageType="predicted"/>
+ </MiningSchema>
+ <NeuralInputs numberOfInputs="8">
+ <NeuralInput id="0">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="rw">
+ <LinearNorm orig="0" norm="-2.889932e-01"/>
+ <LinearNorm orig="9.999901e-02" norm="0"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="1">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="r">
+ <LinearNorm orig="0" norm="-5.756638e-01"/>
+ <LinearNorm orig="2.504894e+04" norm="0"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="2">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tu">
+ <LinearNorm orig="0" norm="-1.699313e-01"/>
+ <LinearNorm orig="8.933486e+04" norm="0"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="3">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tl">
+ <LinearNorm orig="0" norm="-1.707007e-01"/>
+ <LinearNorm orig="8.955232e+01" norm="0"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="4">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hu">
+ <LinearNorm orig="0" norm="-3.302777e-02"/>
+ <LinearNorm orig="1.050003e+03" norm="0"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="5">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hl">
+ <LinearNorm orig="0" norm="-4.562070e-02"/>
+ <LinearNorm orig="7.600007e+02" norm="0"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="6">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="l">
+ <LinearNorm orig="2" norm="1."/>
+ <LinearNorm orig="1.400018e+03" norm="-1."/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="7">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="kw">
+ <LinearNorm orig="0" norm="-5.780019e-02"/>
+ <LinearNorm orig="1.095001e+04" norm="0"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ </NeuralInputs>
+ <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+ <Neuron id="8" bias="-1.263572e+00">
+ <Con from="0" weight="7.536629e-01"/>
+ <Con from="1" weight="1.653660e-03"/>
+ <Con from="2" weight="4.725001e-03"/>
+ <Con from="3" weight="9.969786e-03"/>
+ <Con from="4" weight="1.787976e-01"/>
+ <Con from="5" weight="-1.809809e-01"/>
+ <Con from="6" weight="-1.735688e-01"/>
+ <Con from="7" weight="8.559675e-02"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+ <Neuron id="9" bias="-1.745483e+00">
+ <Con from="8" weight="6.965512e+00"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralOutputs numberOfOutputs="1">
+ <NeuralOutput outputNeuron="9">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="yhat">
+ <LinearNorm orig="0" norm="-5.873935e-01"/>
+ <LinearNorm orig="7.781171e+01" norm="0"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralOutput>
+ <NeuralOutput outputNeuron="-1">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="yhat">
+ <LinearNorm orig="2." norm="-1"/>
+ <LinearNorm orig="5.781171e+01" norm="1"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralOutput>
+ </NeuralOutputs>
+ </NeuralNetwork>
+</PMML>
--- /dev/null
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+ <Header copyright="myCopyright" description="Tests unitaires">
+ <Application name="PMMLlib" version="myVersion"/>
+ <Annotation>Tests unitaires PMMLlib</Annotation>
+ </Header>
+ <DataDictionary>
+ <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
+ <Interval closure="ClosedClosed" leftMargin="1.100000e+01" rightMargin="2.300000e+01"/>
+ </DataField>
+ <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
+ <Interval closure="ClosedClosed" leftMargin="2.810000e+01" rightMargin="7.670000e+01"/>
+ </DataField>
+ <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
+ <Interval closure="ClosedClosed" leftMargin="6.360000e+00" rightMargin="1.251000e+01"/>
+ </DataField>
+ </DataDictionary>
+ <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
+ <MiningSchema>
+ <MiningField name="x6" usageType="active"/>
+ <MiningField name="x8" usageType="active"/>
+ <MiningField name="x1" usageType="predicted"/>
+ </MiningSchema>
+ <RegressionTable intercept="3.837365e+00">
+ <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
+ <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
+ <PredictorTerm coefficient="-2.201903e-02">
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ <PredictorTerm coefficient="5.362560e-04">
+ <FieldRef field="x6"/>
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ </RegressionTable>
+ </RegressionModel>
+</PMML>
--- /dev/null
+<?xml version="1.0"?>
+<PMML version="4.1" xmlns="http://www.dmg.org/PMML-4_1">
+ <Header copyright="myCopyright" description="Text Description">
+ <Application name="Uranie" version="2013.7/18"/>
+ <Annotation>Compilation date : Wed Jul 17, 2013</Annotation>
+ </Header>
+ <DataDictionary>
+ <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
+ <Interval closure="ClosedClosed" leftMargin="1.100000e+01" rightMargin="2.300000e+01"/>
+ </DataField>
+ <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
+ <Interval closure="ClosedClosed" leftMargin="2.810000e+01" rightMargin="7.670000e+01"/>
+ </DataField>
+ <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
+ <Interval closure="ClosedClosed" leftMargin="6.360000e+00" rightMargin="1.251000e+01"/>
+ </DataField>
+ </DataDictionary>
+ <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
+ <MiningSchema>
+ <MiningField name="x6" usageType="active"/>
+ <MiningField name="x8" usageType="active"/>
+ <MiningField name="x1" usageType="predicted"/>
+ </MiningSchema>
+ <RegressionTable>
+ <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
+ <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
+ <PredictorTerm coefficient="-2.201903e-02">
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ <PredictorTerm coefficient="5.362560e-04">
+ <FieldRef field="x6"/>
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ </RegressionTable>
+ </RegressionModel>
+</PMML>
--- /dev/null
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+ <Header copyright="myCopyright" description="Tests unitaires">
+ <Application name="PMMLlib" version="myVersion"/>
+ <Annotation>Tests unitaires PMMLlib</Annotation>
+ </Header>
+ <DataDictionary>
+ <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+ <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+ <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+ <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+ <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+ <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+ <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+ <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+ <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+ </DataDictionary>
+ <NeuralNetwork modelName="modelName" functionName="regression" numberOfLayers="2">
+ <MiningSchema>
+ <MiningField name="rw" usageType="active"/>
+ <MiningField name="r" usageType="active"/>
+ <MiningField name="tu" usageType="active"/>
+ <MiningField name="tl" usageType="active"/>
+ <MiningField name="hu" usageType="active"/>
+ <MiningField name="hl" usageType="active"/>
+ <MiningField name="l" usageType="active"/>
+ <MiningField name="kw" usageType="active"/>
+ <MiningField name="yhat" usageType="predicted"/>
+ </MiningSchema>
+ <NeuralInputs numberOfInputs="8">
+ <NeuralInput id="0">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="rw">
+ <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
+ <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="1">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="r">
+ <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
+ <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="2">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tu">
+ <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
+ <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="3">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tl">
+ <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
+ <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="4">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hu">
+ <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
+ <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="5">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hl">
+ <LineakLRAndkANNrNorm orig="0.000000e+00" norm="-4.562070e-02"/>
+ <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="6">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="l">
+ <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
+ <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="7">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="kw">
+ <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
+ <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ </NeuralInputs>
+ <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+ <Neuron id="8" bias="-1.263572e+00">
+ <Con from="0" weight="7.536629e-01"/>
+ <Con from="1" weight="1.653660e-03"/>
+ <Con from="2" weight="4.725001e-03"/>
+ <Con from="3" weight="9.969786e-03"/>
+ <Con from="4" weight="1.787976e-01"/>
+ <Con from="5" weight="-1.809809e-01"/>
+ <Con from="6" weight="-1.735688e-01"/>
+ <Con from="7" weight="8.559675e-02"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+ <Neuron id="9" bias="-1.745483e+00">
+ <Con from="8" weight="6.965512e+00"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralOutputs numberOfOutputs="1">
+ <NeuralOutput outputNeuron="9">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="yhat">
+ <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
+ <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralOutput>
+ </NeuralOutputs>
+ </NeuralNetwork>
+ <RegressionModel functionName="regression" modelName="modelName" targetFieldName="x1">
+ <MiningSchema>
+ <MiningField name="x6" usageType="active"/>
+ <MiningField name="x8" usageType="active"/>
+ <MiningField name="x1" usageType="predicted"/>
+ </MiningSchema>
+ <RegressionTable intercept="3.837365e+00">
+ <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
+ <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
+ <PredictorTerm coefficient="-2.201903e-02">
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ <PredictorTerm coefficient="5.362560e-04">
+ <FieldRef field="x6"/>
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ </RegressionTable>
+ </RegressionModel>
+</PMML>
--- /dev/null
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+ <Header copyright="myCopyright" description="Tests unitaires">
+ <Application name="PMMLlib" version="myVersion"/>
+ <Annotation>Tests unitaires PMMLlib</Annotation>
+ </Header>
+ <DataDictionary>
+ <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+ <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+ <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+ <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+ <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+ <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+ <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+ <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+ <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+ </DataDictionary>
+ <NeuralNetwork modelName="modelName" functionName="regression" numberOfLayers="2">
+ <MiningSchema>
+ <MiningField name="rw" usageType="active"/>
+ <MiningField name="r" usageType="active"/>
+ <MiningField name="tu" usageType="active"/>
+ <MiningField name="tl" usageType="active"/>
+ <MiningField name="hu" usageType="active"/>
+ <MiningField name="hl" usageType="active"/>
+ <MiningField name="l" usageType="active"/>
+ <MiningField name="kw" usageType="active"/>
+ <MiningField name="yhat" usageType="predicted"/>
+ </MiningSchema>
+ <NeuralInputs numberOfInputs="8">
+ <NeuralInput id="0">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="rw">
+ <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
+ <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="1">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="r">
+ <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
+ <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="2">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tu">
+ <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
+ <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="3">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tl">
+ <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
+ <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="4">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hu">
+ <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
+ <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="5">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hl">
+ <LineakLRAndkANNrNorm orig="0.000000e+00" norm="-4.562070e-02"/>
+ <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="6">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="l">
+ <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
+ <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="7">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="kw">
+ <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
+ <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ </NeuralInputs>
+ <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+ <Neuron id="8" bias="-1.263572e+00">
+ <Con from="0" weight="7.536629e-01"/>
+ <Con from="1" weight="1.653660e-03"/>
+ <Con from="2" weight="4.725001e-03"/>
+ <Con from="3" weight="9.969786e-03"/>
+ <Con from="4" weight="1.787976e-01"/>
+ <Con from="5" weight="-1.809809e-01"/>
+ <Con from="6" weight="-1.735688e-01"/>
+ <Con from="7" weight="8.559675e-02"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+ <Neuron id="9" bias="-1.745483e+00">
+ <Con from="8" weight="6.965512e+00"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralOutputs numberOfOutputs="1">
+ <NeuralOutput outputNeuron="9">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="yhat">
+ <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
+ <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralOutput>
+ </NeuralOutputs>
+ </NeuralNetwork>
+ <RegressionModel functionName="regression" modelName="modelName" targetFieldName="x1">
+ <MiningSchema>
+ <MiningField name="x6" usageType="active"/>
+ <MiningField name="x8" usageType="active"/>
+ <MiningField name="x1" usageType="predicted"/>
+ </MiningSchema>
+ <RegressionTable intercept="3.837365e+00">
+ <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
+ <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
+ <PredictorTerm coefficient="-2.201903e-02">
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ <PredictorTerm coefficient="5.362560e-04">
+ <FieldRef field="x6"/>
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ </RegressionTable>
+ </RegressionModel>
+</PMML>
--- /dev/null
+#define ActivationFunction(sum) ( 1.0 / ( 1.0 + exp( -1.0 * sum )) )
+void myTestFunc(double *param, double *res)
+{
+ //////////////////////////////
+ //
+ // File used by unit test
+ // PMMLBasicsTest1::testExportNeuralNetworkCpp
+ //
+ //////////////////////////////
+
+ int nInput = 8;
+ int nOutput = 1;
+ int nHidden = 1;
+ const int nNeurones = 10;
+ double myTestFunc_act[nNeurones];
+
+ // --- Preprocessing of the inputs and outputs
+ double myTestFunc_minInput[] = {
+ 0.099999, 25048.9, 89334.9, 89.5523, 1050,
+ 760.001, 1400.02, 10950,
+ };
+ double myTestFunc_minOutput[] = {
+ 77.8117, };
+ double myTestFunc_maxInput[] = {
+ 0.028899, 14419.8, 15180.8, 15.2866, 34.6793,
+ 34.6718, 161.826, 632.913,
+ };
+ double myTestFunc_maxOutput[] = {
+ 45.7061, };
+
+ // --- Values of the weights
+ double myTestFunc_valW[] = {
+ -1.74548, 6.96551, -1.26357, 0.753663, 0.00165366,
+ 0.004725, 0.00996979, 0.178798, -0.180981, -0.173569,
+ 0.0855967,
+ };
+ // --- Constants
+ int indNeurone = 0;
+ int CrtW;
+ double sum;
+
+ // --- Input Layers
+ for(int i = 0; i < nInput; i++) {
+ myTestFunc_act[indNeurone++] = ( param[i] - myTestFunc_minInput[i] ) / myTestFunc_maxInput[i];
+ }
+
+ // --- Hidden Layers
+ for (int member = 0; member < nHidden; member++) {
+ int CrtW = member * ( nInput + 2) + 2;
+ sum = myTestFunc_valW[CrtW++];
+ for (int source = 0; source < nInput; source++) {
+ sum += myTestFunc_act[source] * myTestFunc_valW[CrtW++];
+ }
+ myTestFunc_act[indNeurone++] = ActivationFunction(sum);
+ }
+
+ // --- Output
+ for (int member = 0; member < nOutput; member++) {
+ sum = myTestFunc_valW[0];
+ for (int source = 0; source < nHidden; source++) {
+ CrtW = source * ( nInput + 2) + 1;
+ sum += myTestFunc_act[nInput+source] * myTestFunc_valW[CrtW];
+ }
+ myTestFunc_act[indNeurone++] = sum;
+ res[member] = myTestFunc_minOutput[member] + myTestFunc_maxOutput[member] * sum;
+ }
+}
--- /dev/null
+ SUBROUTINE myTestFunc(rw,r,tu,tl,hu,hl,l,kw,yhat)
+C --- *********************************************
+C ---
+C --- File used by unit test
+C --- PMMLBasicsTest1::testExportNeuralNetworkFortran
+C ---
+C --- *********************************************
+ IMPLICIT DOUBLE PRECISION (V)
+ DOUBLE PRECISION rw
+ DOUBLE PRECISION r
+ DOUBLE PRECISION tu
+ DOUBLE PRECISION tl
+ DOUBLE PRECISION hu
+ DOUBLE PRECISION hl
+ DOUBLE PRECISION l
+ DOUBLE PRECISION kw
+ DOUBLE PRECISION yhat
+
+C --- Preprocessing of the inputs
+ VXNrw = ( rw - 0.099999D0 ) / 0.028899D0
+ VXNr = ( r - 25048.9D0 ) / 14419.8D0
+ VXNtu = ( tu - 89334.9D0 ) / 15180.8D0
+ VXNtl = ( tl - 89.5523D0 ) / 15.2866D0
+ VXNhu = ( hu - 1050D0 ) / 34.6793D0
+ VXNhl = ( hl - 760.001D0 ) / 34.6718D0
+ VXNl = ( l - 1400.02D0 ) / 161.826D0
+ VXNkw = ( kw - 10950D0 ) / 632.913D0
+
+C --- Values of the weights
+ VW1 = -1.74548
+ VW2 = 6.96551
+ VW3 = -1.26357
+ VW4 = 0.753663
+ VW5 = 0.00165366
+ VW6 = 0.004725
+ VW7 = 0.00996979
+ VW8 = 0.178798
+ VW9 = -0.180981
+ VW10 = -0.173569
+ VW11 = 0.0855967
+
+C --- hidden neural number 1
+ VAct1 = VW3
+ 1 + VW4 * VXNrw
+ 1 + VW5 * VXNr
+ 1 + VW6 * VXNtu
+ 1 + VW7 * VXNtl
+ 1 + VW8 * VXNhu
+ 1 + VW9 * VXNhl
+ 1 + VW10 * VXNl
+ 1 + VW11 * VXNkw
+
+ VPot1 = 1.D0 / (1.D0 + DEXP(-1.D0 * VAct1))
+
+C --- Output
+ VOut = VW1
+ 1 + VW2 * VPot1
+
+C --- Pretraitment of the output
+ yhat = 77.8117D0 + 45.7061D0 * VOut;
+
+C ---
+ RETURN
+ END
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+from math import tanh, exp
+
+def ActivationFunction(sum):
+ return ( 1.0 / ( 1.0 + exp( -1.0 * sum ) ) );
+
+def myTestFunc(param):
+
+ ##############################
+ #
+ # File used by unit test
+ # PMMLBasicsTest1::testExportNeuralNetworkPython
+ #
+ ##############################
+
+ nInput = 8;
+ nOutput = 1;
+ nHidden = 1;
+ nNeurones = 10;
+ myTestFunc_act = [];
+ res = [];
+
+ # --- Preprocessing of the inputs and outputs
+ myTestFunc_minInput = [
+ 0.099999, 25048.9, 89334.9, 89.5523, 1050,
+ 760.001, 1400.02, 10950,
+ ];
+ myTestFunc_minOutput = [
+ 77.8117
+ ];
+ myTestFunc_maxInput = [
+ 0.028899, 14419.8, 15180.8, 15.2866, 34.6793,
+ 34.6718, 161.826, 632.913,
+ ];
+ myTestFunc_maxOutput = [
+ 45.7061
+ ];
+ # --- Values of the weights
+ myTestFunc_valW = [
+ -1.74548, 6.96551, -1.26357, 0.753663, 0.00165366,
+ 0.004725, 0.00996979, 0.178798, -0.180981, -0.173569,
+ 0.0855967,
+ ];
+ # --- Constants
+ indNeurone = 0;
+
+ # --- Input Layers
+ for i in range(nInput) :
+ myTestFunc_act.append( ( param[i] - myTestFunc_minInput[i] ) / myTestFunc_maxInput[i] ) ;
+ indNeurone += 1 ;
+ pass
+
+ # --- Hidden Layers
+ for member in range(nHidden):
+ CrtW = member * ( nInput + 2) + 2;
+ sum = myTestFunc_valW[CrtW];
+ CrtW += 1 ;
+ for source in range(nInput) :
+ sum += myTestFunc_act[source] * myTestFunc_valW[CrtW];
+ CrtW += 1 ;
+ pass
+ myTestFunc_act.append( ActivationFunction(sum) ) ;
+ indNeurone += 1 ;
+ pass
+
+ # --- Output
+ for member in range(nOutput):
+ sum = myTestFunc_valW[0];
+ for source in range(nHidden):
+ CrtW = source * ( nInput + 2) + 1;
+ sum += myTestFunc_act[nInput+source] * myTestFunc_valW[CrtW];
+ pass
+ myTestFunc_act.append( sum );
+ indNeurone += 1 ;
+ res.append( myTestFunc_minOutput[member] + myTestFunc_maxOutput[member] * sum );
+ pass
+
+ return res;
+
+
--- /dev/null
+void myTestFunc(double *param, double *res)
+{
+ //////////////////////////////
+ //
+ // File used by unit test
+ // PMMLBasicsTest1::testExportLinearRegressionCpp
+ //
+ //////////////////////////////
+
+ // Intercept
+ double y = 3.83737;
+
+ // Attribute : x6
+ y += param[0]*0.475913;
+
+ // Attribute : x8
+ y += param[1]*0.142884;
+
+ // Attribute : x6x8
+ y += param[2]*-0.022019;
+
+ // Attribute : x6x6x8
+ y += param[3]*0.000536256;
+
+ // Return the value
+ res[0] = y;
+}
--- /dev/null
+ SUBROUTINE myTestFunc(P0, P1, P2, P3, RES)
+C --- *********************************************
+C ---
+C --- File used by unit test
+C --- PMMLBasicsTest1::testExportLinearRegressionFortran
+C ---
+C --- *********************************************
+
+ IMPLICIT DOUBLE PRECISION (P)
+ DOUBLE PRECISION RES
+ DOUBLE PRECISION Y
+
+C --- Intercept
+ Y = 3.83737;
+
+C --- Attribute : x6
+ Y += P[0]*0.475913;
+
+C --- Attribute : x8
+ Y += P[1]*0.142884;
+
+C --- Attribute : x6x8
+ Y += P[2]*-0.022019;
+
+C --- Attribute : x6x6x8
+ Y += P[3]*0.000536256;
+
+C --- Return the value
+ RES = Y
+ RETURN
+ END
--- /dev/null
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+def myTestFunc(param):
+
+ ##############################
+ #
+ # File used by unit test
+ # PMMLBasicsTest1::testExportLinearRegressionPython
+ #
+ ##############################
+
+ # Intercept
+ y = 3.83737;
+
+ # Attribute : x6
+ y += param[0]*0.475913;
+
+ # Attribute : x8
+ y += param[1]*0.142884;
+
+ # Attribute : x6x8
+ y += param[2]*-0.022019;
+
+ # Attribute : x6x6x8
+ y += param[3]*0.000536256;
+
+ # Return the value
+ return [y];
--- /dev/null
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+ <Header copyright="myCopyright" description="Tests unitaires">
+ <Application name="PMMLlib" version="myVersion"/>
+ <Annotation>Tests unitaires PMMLlib</Annotation>
+ </Header>
+ <DataDictionary>
+ <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
+ <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
+ <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
+ <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
+ <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
+ <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
+ <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
+ <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
+ <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
+ </DataDictionary>
+ <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
+ <MiningSchema>
+ <MiningField name="rw" usageType="active"/>
+ <MiningField name="r" usageType="active"/>
+ <MiningField name="tu" usageType="active"/>
+ <MiningField name="tl" usageType="active"/>
+ <MiningField name="hu" usageType="active"/>
+ <MiningField name="hl" usageType="active"/>
+ <MiningField name="l" usageType="active"/>
+ <MiningField name="kw" usageType="active"/>
+ <MiningField name="yhat" usageType="predicted"/>
+ </MiningSchema>
+ <NeuralInputs numberOfInputs="8">
+ <NeuralInput id="0">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="rw">
+ <LinearNorm orig="0.000000e+000" norm="-2.889932e-001"/>
+ <LinearNorm orig="9.999901e-002" norm="0.000000e+000"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="1">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="r">
+ <LinearNorm orig="0.000000e+000" norm="-5.756638e-001"/>
+ <LinearNorm orig="2.504894e+004" norm="0.000000e+000"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="2">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tu">
+ <LinearNorm orig="0.000000e+000" norm="-1.699313e-001"/>
+ <LinearNorm orig="8.933486e+004" norm="0.000000e+000"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="3">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="tl">
+ <LinearNorm orig="0.000000e+000" norm="-1.707007e-001"/>
+ <LinearNorm orig="8.955232e+001" norm="0.000000e+000"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="4">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hu">
+ <LinearNorm orig="0.000000e+000" norm="-3.302777e-002"/>
+ <LinearNorm orig="1.050003e+003" norm="0.000000e+000"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="5">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="hl">
+ <LinearNorm orig="0.000000e+000" norm="-4.562070e-002"/>
+ <LinearNorm orig="7.600007e+002" norm="0.000000e+000"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="6">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="l">
+ <LinearNorm orig="0.000000e+000" norm="-1.155882e-001"/>
+ <LinearNorm orig="1.400018e+003" norm="0.000000e+000"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ <NeuralInput id="7">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="kw">
+ <LinearNorm orig="0.000000e+000" norm="-5.780019e-002"/>
+ <LinearNorm orig="1.095001e+004" norm="0.000000e+000"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralInput>
+ </NeuralInputs>
+ <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
+ <Neuron id="8" bias="-1.263572e+000">
+ <Con from="0" weight="7.536629e-001"/>
+ <Con from="1" weight="1.653660e-003"/>
+ <Con from="2" weight="4.725001e-003"/>
+ <Con from="3" weight="9.969786e-003"/>
+ <Con from="4" weight="1.787976e-001"/>
+ <Con from="5" weight="-1.809809e-001"/>
+ <Con from="6" weight="-1.735688e-001"/>
+ <Con from="7" weight="8.559675e-002"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralLayer activationFunction="identity" numberOfNeurons="1">
+ <Neuron id="9" bias="-1.745483e+000">
+ <Con from="8" weight="6.965512e+000"/>
+ </Neuron>
+ </NeuralLayer>
+ <NeuralOutputs numberOfOutputs="1">
+ <NeuralOutput outputNeuron="9">
+ <DerivedField optype="continuous" dataType="float">
+ <NormContinuous field="yhat">
+ <LinearNorm orig="0.000000e+000" norm="-5.873935e-001"/>
+ <LinearNorm orig="7.781171e+001" norm="0.000000e+000"/>
+ </NormContinuous>
+ </DerivedField>
+ </NeuralOutput>
+ </NeuralOutputs>
+ </NeuralNetwork>
+</PMML>
--- /dev/null
+<?xml version="1.0"?>
+<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
+ <Header copyright="myCopyright" description="Tests unitaires">
+ <Application name="PMMLlib" version="myVersion"/>
+ <Annotation>Tests unitaires PMMLlib</Annotation>
+ </Header>
+ <DataDictionary>
+ <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
+ <Interval closure="ClosedClosed" leftMargin="1.100000e+001" rightMargin="2.300000e+001"/>
+ </DataField>
+ <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
+ <Interval closure="ClosedClosed" leftMargin="2.810000e+001" rightMargin="7.670000e+001"/>
+ </DataField>
+ <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
+ <Interval closure="ClosedClosed" leftMargin="6.360000e+000" rightMargin="1.251000e+001"/>
+ </DataField>
+ </DataDictionary>
+ <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
+ <MiningSchema>
+ <MiningField name="x6" usageType="active"/>
+ <MiningField name="x8" usageType="active"/>
+ <MiningField name="x1" usageType="predicted"/>
+ </MiningSchema>
+ <RegressionTable intercept="3.837365e+000">
+ <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-001"/>
+ <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-001"/>
+ <PredictorTerm coefficient="-2.201903e-002">
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ <PredictorTerm coefficient="5.362560e-004">
+ <FieldRef field="x6"/>
+ <FieldRef field="x6"/>
+ <FieldRef field="x8"/>
+ </PredictorTerm>
+ </RegressionTable>
+ </RegressionModel>
+</PMML>
class PMMLBasicsTest(unittest.TestCase):
def setUp(self):
- pmmlRootDir = os.getenv("YACS_ROOT_DIR");
- self.resourcesDir = os.path.join(pmmlRootDir,"share","salome","resources","pmml");
- self.resourcesDir += os.sep ;
- self.tmpDir = "/tmp/";
- self.tmpDir += os.environ['LOGNAME']; # ("USER");
- self.tmpDir += "/PmmlUnitTest/";
+ self.resourcesDir = ".." + os.sep + "Test" + os.sep + "samples" + os.sep ;
+ self.tmpDir = os.sep + "tmp" + os.sep + os.environ['LOGNAME'] + os.sep ;
+ self.tmpDir += "PmmlUnitTest";
+ self.tmpDir += os.sep ;
if ( not os.path.exists(self.tmpDir) ):
os.mkdir(self.tmpDir);
pass
+++ /dev/null
-# Copyright (C) 2012-2014 CEA/DEN, EDF R&D
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-#
-# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-#
-
-SET(PMML_RESOURCES_FILES
- # ici les noms des fichiers ressources
- ann_model.pmml
- ann_model_2.pmml
- lr_model.pmml
- lr_model_2.pmml
- no_model.pmml
- two_models_ann_lr.pmml
- unittest_ref_ann_model.cpp
- unittest_ref_ann_model.f
- unittest_ref_ann_model.py
- unittest_ref_lr_model.cpp
- unittest_ref_lr_model.f
- unittest_ref_lr_model.py
- win32_ann_model.pmml
- win32_lr_model.pmml
- )
-
-INSTALL(FILES ${PMML_RESOURCES_FILES} DESTINATION ${SALOME_PMML_INSTALL_RES_DATA})
-
-# MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml")
-# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/PMMLCatalog.xml.in ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml @ONLY)
-# MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml")
-# CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml @ONLY)
-
-# INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PMMLCatalog.xml ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml DESTINATION ${SALOME_PMML_INSTALL_RES_DATA})
+++ /dev/null
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
- <Header copyright="myCopyright" description="Tests unitaires">
- <Application name="PMMLlib" version="myVersion"/>
- <Annotation>Tests unitaires PMMLlib</Annotation>
- </Header>
- <DataDictionary>
- <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
- <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
- <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
- <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
- <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
- <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
- <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
- <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
- <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
- </DataDictionary>
- <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
- <MiningSchema>
- <MiningField name="rw" usageType="active"/>
- <MiningField name="r" usageType="active"/>
- <MiningField name="tu" usageType="active"/>
- <MiningField name="tl" usageType="active"/>
- <MiningField name="hu" usageType="active"/>
- <MiningField name="hl" usageType="active"/>
- <MiningField name="l" usageType="active"/>
- <MiningField name="kw" usageType="active"/>
- <MiningField name="yhat" usageType="predicted"/>
- </MiningSchema>
- <NeuralInputs numberOfInputs="8">
- <NeuralInput id="0">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="rw">
- <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
- <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="1">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="r">
- <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
- <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="2">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tu">
- <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
- <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="3">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tl">
- <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
- <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="4">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hu">
- <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
- <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="5">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hl">
- <LinearNorm orig="0.000000e+00" norm="-4.562070e-02"/>
- <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="6">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="l">
- <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
- <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="7">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="kw">
- <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
- <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- </NeuralInputs>
- <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
- <Neuron id="8" bias="-1.263572e+00">
- <Con from="0" weight="7.536629e-01"/>
- <Con from="1" weight="1.653660e-03"/>
- <Con from="2" weight="4.725001e-03"/>
- <Con from="3" weight="9.969786e-03"/>
- <Con from="4" weight="1.787976e-01"/>
- <Con from="5" weight="-1.809809e-01"/>
- <Con from="6" weight="-1.735688e-01"/>
- <Con from="7" weight="8.559675e-02"/>
- </Neuron>
- </NeuralLayer>
- <NeuralLayer activationFunction="identity" numberOfNeurons="1">
- <Neuron id="9" bias="-1.745483e+00">
- <Con from="8" weight="6.965512e+00"/>
- </Neuron>
- </NeuralLayer>
- <NeuralOutputs numberOfOutputs="1">
- <NeuralOutput outputNeuron="9">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="yhat">
- <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
- <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralOutput>
- </NeuralOutputs>
- </NeuralNetwork>
-</PMML>
+++ /dev/null
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-3_0" version="3.0">
- <Header copyright="texte copyright" description="texte description">
- <Application name="Uranie" version="2.3/1"/>
- <Annotation>date Fri Oct 07, 2011</Annotation>
- </Header>
- <DataDictionary>
- <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
- <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
- <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
- <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
- <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
- <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
- <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
- <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
- <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
- </DataDictionary>
- <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
- <MiningSchema>
- <MiningField name="rw" usageType="active"/>
- <MiningField name="r" usageType="active"/>
- <MiningField name="tu" usageType="active"/>
- <MiningField name="tl" usageType="active"/>
- <MiningField name="hu" usageType="active"/>
- <MiningField name="hl" usageType="active"/>
- <MiningField name="l" usageType="active"/>
- <MiningField name="kw" usageType="active"/>
- <MiningField name="yhat" usageType="predicted"/>
- </MiningSchema>
- <NeuralInputs numberOfInputs="8">
- <NeuralInput id="0">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="rw">
- <LinearNorm orig="0" norm="-2.889932e-01"/>
- <LinearNorm orig="9.999901e-02" norm="0"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="1">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="r">
- <LinearNorm orig="0" norm="-5.756638e-01"/>
- <LinearNorm orig="2.504894e+04" norm="0"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="2">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tu">
- <LinearNorm orig="0" norm="-1.699313e-01"/>
- <LinearNorm orig="8.933486e+04" norm="0"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="3">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tl">
- <LinearNorm orig="0" norm="-1.707007e-01"/>
- <LinearNorm orig="8.955232e+01" norm="0"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="4">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hu">
- <LinearNorm orig="0" norm="-3.302777e-02"/>
- <LinearNorm orig="1.050003e+03" norm="0"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="5">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hl">
- <LinearNorm orig="0" norm="-4.562070e-02"/>
- <LinearNorm orig="7.600007e+02" norm="0"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="6">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="l">
- <LinearNorm orig="2" norm="1."/>
- <LinearNorm orig="1.400018e+03" norm="-1."/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="7">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="kw">
- <LinearNorm orig="0" norm="-5.780019e-02"/>
- <LinearNorm orig="1.095001e+04" norm="0"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- </NeuralInputs>
- <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
- <Neuron id="8" bias="-1.263572e+00">
- <Con from="0" weight="7.536629e-01"/>
- <Con from="1" weight="1.653660e-03"/>
- <Con from="2" weight="4.725001e-03"/>
- <Con from="3" weight="9.969786e-03"/>
- <Con from="4" weight="1.787976e-01"/>
- <Con from="5" weight="-1.809809e-01"/>
- <Con from="6" weight="-1.735688e-01"/>
- <Con from="7" weight="8.559675e-02"/>
- </Neuron>
- </NeuralLayer>
- <NeuralLayer activationFunction="identity" numberOfNeurons="1">
- <Neuron id="9" bias="-1.745483e+00">
- <Con from="8" weight="6.965512e+00"/>
- </Neuron>
- </NeuralLayer>
- <NeuralOutputs numberOfOutputs="1">
- <NeuralOutput outputNeuron="9">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="yhat">
- <LinearNorm orig="0" norm="-5.873935e-01"/>
- <LinearNorm orig="7.781171e+01" norm="0"/>
- </NormContinuous>
- </DerivedField>
- </NeuralOutput>
- <NeuralOutput outputNeuron="-1">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="yhat">
- <LinearNorm orig="2." norm="-1"/>
- <LinearNorm orig="5.781171e+01" norm="1"/>
- </NormContinuous>
- </DerivedField>
- </NeuralOutput>
- </NeuralOutputs>
- </NeuralNetwork>
-</PMML>
+++ /dev/null
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
- <Header copyright="myCopyright" description="Tests unitaires">
- <Application name="PMMLlib" version="myVersion"/>
- <Annotation>Tests unitaires PMMLlib</Annotation>
- </Header>
- <DataDictionary>
- <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
- <Interval closure="ClosedClosed" leftMargin="1.100000e+01" rightMargin="2.300000e+01"/>
- </DataField>
- <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
- <Interval closure="ClosedClosed" leftMargin="2.810000e+01" rightMargin="7.670000e+01"/>
- </DataField>
- <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
- <Interval closure="ClosedClosed" leftMargin="6.360000e+00" rightMargin="1.251000e+01"/>
- </DataField>
- </DataDictionary>
- <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
- <MiningSchema>
- <MiningField name="x6" usageType="active"/>
- <MiningField name="x8" usageType="active"/>
- <MiningField name="x1" usageType="predicted"/>
- </MiningSchema>
- <RegressionTable intercept="3.837365e+00">
- <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
- <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
- <PredictorTerm coefficient="-2.201903e-02">
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- <PredictorTerm coefficient="5.362560e-04">
- <FieldRef field="x6"/>
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- </RegressionTable>
- </RegressionModel>
-</PMML>
+++ /dev/null
-<?xml version="1.0"?>
-<PMML version="4.1" xmlns="http://www.dmg.org/PMML-4_1">
- <Header copyright="myCopyright" description="Text Description">
- <Application name="Uranie" version="2013.7/18"/>
- <Annotation>Compilation date : Wed Jul 17, 2013</Annotation>
- </Header>
- <DataDictionary>
- <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
- <Interval closure="ClosedClosed" leftMargin="1.100000e+01" rightMargin="2.300000e+01"/>
- </DataField>
- <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
- <Interval closure="ClosedClosed" leftMargin="2.810000e+01" rightMargin="7.670000e+01"/>
- </DataField>
- <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
- <Interval closure="ClosedClosed" leftMargin="6.360000e+00" rightMargin="1.251000e+01"/>
- </DataField>
- </DataDictionary>
- <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
- <MiningSchema>
- <MiningField name="x6" usageType="active"/>
- <MiningField name="x8" usageType="active"/>
- <MiningField name="x1" usageType="predicted"/>
- </MiningSchema>
- <RegressionTable>
- <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
- <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
- <PredictorTerm coefficient="-2.201903e-02">
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- <PredictorTerm coefficient="5.362560e-04">
- <FieldRef field="x6"/>
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- </RegressionTable>
- </RegressionModel>
-</PMML>
+++ /dev/null
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
- <Header copyright="myCopyright" description="Tests unitaires">
- <Application name="PMMLlib" version="myVersion"/>
- <Annotation>Tests unitaires PMMLlib</Annotation>
- </Header>
- <DataDictionary>
- <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
- <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
- <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
- <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
- <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
- <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
- <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
- <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
- <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
- </DataDictionary>
- <NeuralNetwork modelName="modelName" functionName="regression" numberOfLayers="2">
- <MiningSchema>
- <MiningField name="rw" usageType="active"/>
- <MiningField name="r" usageType="active"/>
- <MiningField name="tu" usageType="active"/>
- <MiningField name="tl" usageType="active"/>
- <MiningField name="hu" usageType="active"/>
- <MiningField name="hl" usageType="active"/>
- <MiningField name="l" usageType="active"/>
- <MiningField name="kw" usageType="active"/>
- <MiningField name="yhat" usageType="predicted"/>
- </MiningSchema>
- <NeuralInputs numberOfInputs="8">
- <NeuralInput id="0">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="rw">
- <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
- <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="1">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="r">
- <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
- <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="2">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tu">
- <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
- <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="3">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tl">
- <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
- <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="4">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hu">
- <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
- <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="5">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hl">
- <LineakLRAndkANNrNorm orig="0.000000e+00" norm="-4.562070e-02"/>
- <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="6">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="l">
- <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
- <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="7">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="kw">
- <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
- <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- </NeuralInputs>
- <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
- <Neuron id="8" bias="-1.263572e+00">
- <Con from="0" weight="7.536629e-01"/>
- <Con from="1" weight="1.653660e-03"/>
- <Con from="2" weight="4.725001e-03"/>
- <Con from="3" weight="9.969786e-03"/>
- <Con from="4" weight="1.787976e-01"/>
- <Con from="5" weight="-1.809809e-01"/>
- <Con from="6" weight="-1.735688e-01"/>
- <Con from="7" weight="8.559675e-02"/>
- </Neuron>
- </NeuralLayer>
- <NeuralLayer activationFunction="identity" numberOfNeurons="1">
- <Neuron id="9" bias="-1.745483e+00">
- <Con from="8" weight="6.965512e+00"/>
- </Neuron>
- </NeuralLayer>
- <NeuralOutputs numberOfOutputs="1">
- <NeuralOutput outputNeuron="9">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="yhat">
- <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
- <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralOutput>
- </NeuralOutputs>
- </NeuralNetwork>
- <RegressionModel functionName="regression" modelName="modelName" targetFieldName="x1">
- <MiningSchema>
- <MiningField name="x6" usageType="active"/>
- <MiningField name="x8" usageType="active"/>
- <MiningField name="x1" usageType="predicted"/>
- </MiningSchema>
- <RegressionTable intercept="3.837365e+00">
- <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
- <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
- <PredictorTerm coefficient="-2.201903e-02">
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- <PredictorTerm coefficient="5.362560e-04">
- <FieldRef field="x6"/>
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- </RegressionTable>
- </RegressionModel>
-</PMML>
+++ /dev/null
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
- <Header copyright="myCopyright" description="Tests unitaires">
- <Application name="PMMLlib" version="myVersion"/>
- <Annotation>Tests unitaires PMMLlib</Annotation>
- </Header>
- <DataDictionary>
- <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
- <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
- <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
- <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
- <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
- <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
- <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
- <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
- <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
- </DataDictionary>
- <NeuralNetwork modelName="modelName" functionName="regression" numberOfLayers="2">
- <MiningSchema>
- <MiningField name="rw" usageType="active"/>
- <MiningField name="r" usageType="active"/>
- <MiningField name="tu" usageType="active"/>
- <MiningField name="tl" usageType="active"/>
- <MiningField name="hu" usageType="active"/>
- <MiningField name="hl" usageType="active"/>
- <MiningField name="l" usageType="active"/>
- <MiningField name="kw" usageType="active"/>
- <MiningField name="yhat" usageType="predicted"/>
- </MiningSchema>
- <NeuralInputs numberOfInputs="8">
- <NeuralInput id="0">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="rw">
- <LinearNorm orig="0.000000e+00" norm="-2.889932e-01"/>
- <LinearNorm orig="9.999901e-02" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="1">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="r">
- <LinearNorm orig="0.000000e+00" norm="-5.756638e-01"/>
- <LinearNorm orig="2.504894e+04" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="2">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tu">
- <LinearNorm orig="0.000000e+00" norm="-1.699313e-01"/>
- <LinearNorm orig="8.933486e+04" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="3">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tl">
- <LinearNorm orig="0.000000e+00" norm="-1.707007e-01"/>
- <LinearNorm orig="8.955232e+01" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="4">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hu">
- <LinearNorm orig="0.000000e+00" norm="-3.302777e-02"/>
- <LinearNorm orig="1.050003e+03" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="5">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hl">
- <LineakLRAndkANNrNorm orig="0.000000e+00" norm="-4.562070e-02"/>
- <LinearNorm orig="7.600007e+02" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="6">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="l">
- <LinearNorm orig="0.000000e+00" norm="-1.155882e-01"/>
- <LinearNorm orig="1.400018e+03" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="7">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="kw">
- <LinearNorm orig="0.000000e+00" norm="-5.780019e-02"/>
- <LinearNorm orig="1.095001e+04" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- </NeuralInputs>
- <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
- <Neuron id="8" bias="-1.263572e+00">
- <Con from="0" weight="7.536629e-01"/>
- <Con from="1" weight="1.653660e-03"/>
- <Con from="2" weight="4.725001e-03"/>
- <Con from="3" weight="9.969786e-03"/>
- <Con from="4" weight="1.787976e-01"/>
- <Con from="5" weight="-1.809809e-01"/>
- <Con from="6" weight="-1.735688e-01"/>
- <Con from="7" weight="8.559675e-02"/>
- </Neuron>
- </NeuralLayer>
- <NeuralLayer activationFunction="identity" numberOfNeurons="1">
- <Neuron id="9" bias="-1.745483e+00">
- <Con from="8" weight="6.965512e+00"/>
- </Neuron>
- </NeuralLayer>
- <NeuralOutputs numberOfOutputs="1">
- <NeuralOutput outputNeuron="9">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="yhat">
- <LinearNorm orig="0.000000e+00" norm="-5.873935e-01"/>
- <LinearNorm orig="7.781171e+01" norm="0.000000e+00"/>
- </NormContinuous>
- </DerivedField>
- </NeuralOutput>
- </NeuralOutputs>
- </NeuralNetwork>
- <RegressionModel functionName="regression" modelName="modelName" targetFieldName="x1">
- <MiningSchema>
- <MiningField name="x6" usageType="active"/>
- <MiningField name="x8" usageType="active"/>
- <MiningField name="x1" usageType="predicted"/>
- </MiningSchema>
- <RegressionTable intercept="3.837365e+00">
- <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-01"/>
- <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-01"/>
- <PredictorTerm coefficient="-2.201903e-02">
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- <PredictorTerm coefficient="5.362560e-04">
- <FieldRef field="x6"/>
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- </RegressionTable>
- </RegressionModel>
-</PMML>
+++ /dev/null
-#define ActivationFunction(sum) ( 1.0 / ( 1.0 + exp( -1.0 * sum )) )
-void myTestFunc(double *param, double *res)
-{
- //////////////////////////////
- //
- // File used by unit test
- // PMMLBasicsTest1::testExportNeuralNetworkCpp
- //
- //////////////////////////////
-
- int nInput = 8;
- int nOutput = 1;
- int nHidden = 1;
- const int nNeurones = 10;
- double myTestFunc_act[nNeurones];
-
- // --- Preprocessing of the inputs and outputs
- double myTestFunc_minInput[] = {
- 0.099999, 25048.9, 89334.9, 89.5523, 1050,
- 760.001, 1400.02, 10950,
- };
- double myTestFunc_minOutput[] = {
- 77.8117, };
- double myTestFunc_maxInput[] = {
- 0.028899, 14419.8, 15180.8, 15.2866, 34.6793,
- 34.6718, 161.826, 632.913,
- };
- double myTestFunc_maxOutput[] = {
- 45.7061, };
-
- // --- Values of the weights
- double myTestFunc_valW[] = {
- -1.74548, 6.96551, -1.26357, 0.753663, 0.00165366,
- 0.004725, 0.00996979, 0.178798, -0.180981, -0.173569,
- 0.0855967,
- };
- // --- Constants
- int indNeurone = 0;
- int CrtW;
- double sum;
-
- // --- Input Layers
- for(int i = 0; i < nInput; i++) {
- myTestFunc_act[indNeurone++] = ( param[i] - myTestFunc_minInput[i] ) / myTestFunc_maxInput[i];
- }
-
- // --- Hidden Layers
- for (int member = 0; member < nHidden; member++) {
- int CrtW = member * ( nInput + 2) + 2;
- sum = myTestFunc_valW[CrtW++];
- for (int source = 0; source < nInput; source++) {
- sum += myTestFunc_act[source] * myTestFunc_valW[CrtW++];
- }
- myTestFunc_act[indNeurone++] = ActivationFunction(sum);
- }
-
- // --- Output
- for (int member = 0; member < nOutput; member++) {
- sum = myTestFunc_valW[0];
- for (int source = 0; source < nHidden; source++) {
- CrtW = source * ( nInput + 2) + 1;
- sum += myTestFunc_act[nInput+source] * myTestFunc_valW[CrtW];
- }
- myTestFunc_act[indNeurone++] = sum;
- res[member] = myTestFunc_minOutput[member] + myTestFunc_maxOutput[member] * sum;
- }
-}
+++ /dev/null
- SUBROUTINE myTestFunc(rw,r,tu,tl,hu,hl,l,kw,yhat)
-C --- *********************************************
-C ---
-C --- File used by unit test
-C --- PMMLBasicsTest1::testExportNeuralNetworkFortran
-C ---
-C --- *********************************************
- IMPLICIT DOUBLE PRECISION (V)
- DOUBLE PRECISION rw
- DOUBLE PRECISION r
- DOUBLE PRECISION tu
- DOUBLE PRECISION tl
- DOUBLE PRECISION hu
- DOUBLE PRECISION hl
- DOUBLE PRECISION l
- DOUBLE PRECISION kw
- DOUBLE PRECISION yhat
-
-C --- Preprocessing of the inputs
- VXNrw = ( rw - 0.099999D0 ) / 0.028899D0
- VXNr = ( r - 25048.9D0 ) / 14419.8D0
- VXNtu = ( tu - 89334.9D0 ) / 15180.8D0
- VXNtl = ( tl - 89.5523D0 ) / 15.2866D0
- VXNhu = ( hu - 1050D0 ) / 34.6793D0
- VXNhl = ( hl - 760.001D0 ) / 34.6718D0
- VXNl = ( l - 1400.02D0 ) / 161.826D0
- VXNkw = ( kw - 10950D0 ) / 632.913D0
-
-C --- Values of the weights
- VW1 = -1.74548
- VW2 = 6.96551
- VW3 = -1.26357
- VW4 = 0.753663
- VW5 = 0.00165366
- VW6 = 0.004725
- VW7 = 0.00996979
- VW8 = 0.178798
- VW9 = -0.180981
- VW10 = -0.173569
- VW11 = 0.0855967
-
-C --- hidden neural number 1
- VAct1 = VW3
- 1 + VW4 * VXNrw
- 1 + VW5 * VXNr
- 1 + VW6 * VXNtu
- 1 + VW7 * VXNtl
- 1 + VW8 * VXNhu
- 1 + VW9 * VXNhl
- 1 + VW10 * VXNl
- 1 + VW11 * VXNkw
-
- VPot1 = 1.D0 / (1.D0 + DEXP(-1.D0 * VAct1))
-
-C --- Output
- VOut = VW1
- 1 + VW2 * VPot1
-
-C --- Pretraitment of the output
- yhat = 77.8117D0 + 45.7061D0 * VOut;
-
-C ---
- RETURN
- END
+++ /dev/null
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-from math import tanh, exp
-
-def ActivationFunction(sum):
- return ( 1.0 / ( 1.0 + exp( -1.0 * sum ) ) );
-
-def myTestFunc(param):
-
- ##############################
- #
- # File used by unit test
- # PMMLBasicsTest1::testExportNeuralNetworkPython
- #
- ##############################
-
- nInput = 8;
- nOutput = 1;
- nHidden = 1;
- nNeurones = 10;
- myTestFunc_act = [];
- res = [];
-
- # --- Preprocessing of the inputs and outputs
- myTestFunc_minInput = [
- 0.099999, 25048.9, 89334.9, 89.5523, 1050,
- 760.001, 1400.02, 10950,
- ];
- myTestFunc_minOutput = [
- 77.8117
- ];
- myTestFunc_maxInput = [
- 0.028899, 14419.8, 15180.8, 15.2866, 34.6793,
- 34.6718, 161.826, 632.913,
- ];
- myTestFunc_maxOutput = [
- 45.7061
- ];
- # --- Values of the weights
- myTestFunc_valW = [
- -1.74548, 6.96551, -1.26357, 0.753663, 0.00165366,
- 0.004725, 0.00996979, 0.178798, -0.180981, -0.173569,
- 0.0855967,
- ];
- # --- Constants
- indNeurone = 0;
-
- # --- Input Layers
- for i in range(nInput) :
- myTestFunc_act.append( ( param[i] - myTestFunc_minInput[i] ) / myTestFunc_maxInput[i] ) ;
- indNeurone += 1 ;
- pass
-
- # --- Hidden Layers
- for member in range(nHidden):
- CrtW = member * ( nInput + 2) + 2;
- sum = myTestFunc_valW[CrtW];
- CrtW += 1 ;
- for source in range(nInput) :
- sum += myTestFunc_act[source] * myTestFunc_valW[CrtW];
- CrtW += 1 ;
- pass
- myTestFunc_act.append( ActivationFunction(sum) ) ;
- indNeurone += 1 ;
- pass
-
- # --- Output
- for member in range(nOutput):
- sum = myTestFunc_valW[0];
- for source in range(nHidden):
- CrtW = source * ( nInput + 2) + 1;
- sum += myTestFunc_act[nInput+source] * myTestFunc_valW[CrtW];
- pass
- myTestFunc_act.append( sum );
- indNeurone += 1 ;
- res.append( myTestFunc_minOutput[member] + myTestFunc_maxOutput[member] * sum );
- pass
-
- return res;
-
-
+++ /dev/null
-void myTestFunc(double *param, double *res)
-{
- //////////////////////////////
- //
- // File used by unit test
- // PMMLBasicsTest1::testExportLinearRegressionCpp
- //
- //////////////////////////////
-
- // Intercept
- double y = 3.83737;
-
- // Attribute : x6
- y += param[0]*0.475913;
-
- // Attribute : x8
- y += param[1]*0.142884;
-
- // Attribute : x6x8
- y += param[2]*-0.022019;
-
- // Attribute : x6x6x8
- y += param[3]*0.000536256;
-
- // Return the value
- res[0] = y;
-}
+++ /dev/null
- SUBROUTINE myTestFunc(P0, P1, P2, P3, RES)
-C --- *********************************************
-C ---
-C --- File used by unit test
-C --- PMMLBasicsTest1::testExportLinearRegressionFortran
-C ---
-C --- *********************************************
-
- IMPLICIT DOUBLE PRECISION (P)
- DOUBLE PRECISION RES
- DOUBLE PRECISION Y
-
-C --- Intercept
- Y = 3.83737;
-
-C --- Attribute : x6
- Y += P[0]*0.475913;
-
-C --- Attribute : x8
- Y += P[1]*0.142884;
-
-C --- Attribute : x6x8
- Y += P[2]*-0.022019;
-
-C --- Attribute : x6x6x8
- Y += P[3]*0.000536256;
-
-C --- Return the value
- RES = Y
- RETURN
- END
+++ /dev/null
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-def myTestFunc(param):
-
- ##############################
- #
- # File used by unit test
- # PMMLBasicsTest1::testExportLinearRegressionPython
- #
- ##############################
-
- # Intercept
- y = 3.83737;
-
- # Attribute : x6
- y += param[0]*0.475913;
-
- # Attribute : x8
- y += param[1]*0.142884;
-
- # Attribute : x6x8
- y += param[2]*-0.022019;
-
- # Attribute : x6x6x8
- y += param[3]*0.000536256;
-
- # Return the value
- return [y];
+++ /dev/null
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
- <Header copyright="myCopyright" description="Tests unitaires">
- <Application name="PMMLlib" version="myVersion"/>
- <Annotation>Tests unitaires PMMLlib</Annotation>
- </Header>
- <DataDictionary>
- <DataField name="rw" displayName="rw" optype="continuous" dataType="float"/>
- <DataField name="r" displayName="r" optype="continuous" dataType="float"/>
- <DataField name="tu" displayName="tu" optype="continuous" dataType="float"/>
- <DataField name="tl" displayName="tl" optype="continuous" dataType="float"/>
- <DataField name="hu" displayName="hu" optype="continuous" dataType="float"/>
- <DataField name="hl" displayName="hl" optype="continuous" dataType="float"/>
- <DataField name="l" displayName="l" optype="continuous" dataType="float"/>
- <DataField name="kw" displayName="kw" optype="continuous" dataType="float"/>
- <DataField name="yhat" displayName="yhat" optype="continuous" dataType="float"/>
- </DataDictionary>
- <NeuralNetwork modelName="sANNName" functionName="regression" numberOfLayers="2">
- <MiningSchema>
- <MiningField name="rw" usageType="active"/>
- <MiningField name="r" usageType="active"/>
- <MiningField name="tu" usageType="active"/>
- <MiningField name="tl" usageType="active"/>
- <MiningField name="hu" usageType="active"/>
- <MiningField name="hl" usageType="active"/>
- <MiningField name="l" usageType="active"/>
- <MiningField name="kw" usageType="active"/>
- <MiningField name="yhat" usageType="predicted"/>
- </MiningSchema>
- <NeuralInputs numberOfInputs="8">
- <NeuralInput id="0">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="rw">
- <LinearNorm orig="0.000000e+000" norm="-2.889932e-001"/>
- <LinearNorm orig="9.999901e-002" norm="0.000000e+000"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="1">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="r">
- <LinearNorm orig="0.000000e+000" norm="-5.756638e-001"/>
- <LinearNorm orig="2.504894e+004" norm="0.000000e+000"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="2">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tu">
- <LinearNorm orig="0.000000e+000" norm="-1.699313e-001"/>
- <LinearNorm orig="8.933486e+004" norm="0.000000e+000"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="3">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="tl">
- <LinearNorm orig="0.000000e+000" norm="-1.707007e-001"/>
- <LinearNorm orig="8.955232e+001" norm="0.000000e+000"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="4">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hu">
- <LinearNorm orig="0.000000e+000" norm="-3.302777e-002"/>
- <LinearNorm orig="1.050003e+003" norm="0.000000e+000"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="5">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="hl">
- <LinearNorm orig="0.000000e+000" norm="-4.562070e-002"/>
- <LinearNorm orig="7.600007e+002" norm="0.000000e+000"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="6">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="l">
- <LinearNorm orig="0.000000e+000" norm="-1.155882e-001"/>
- <LinearNorm orig="1.400018e+003" norm="0.000000e+000"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- <NeuralInput id="7">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="kw">
- <LinearNorm orig="0.000000e+000" norm="-5.780019e-002"/>
- <LinearNorm orig="1.095001e+004" norm="0.000000e+000"/>
- </NormContinuous>
- </DerivedField>
- </NeuralInput>
- </NeuralInputs>
- <NeuralLayer activationFunction="tanh" numberOfNeurons="1">
- <Neuron id="8" bias="-1.263572e+000">
- <Con from="0" weight="7.536629e-001"/>
- <Con from="1" weight="1.653660e-003"/>
- <Con from="2" weight="4.725001e-003"/>
- <Con from="3" weight="9.969786e-003"/>
- <Con from="4" weight="1.787976e-001"/>
- <Con from="5" weight="-1.809809e-001"/>
- <Con from="6" weight="-1.735688e-001"/>
- <Con from="7" weight="8.559675e-002"/>
- </Neuron>
- </NeuralLayer>
- <NeuralLayer activationFunction="identity" numberOfNeurons="1">
- <Neuron id="9" bias="-1.745483e+000">
- <Con from="8" weight="6.965512e+000"/>
- </Neuron>
- </NeuralLayer>
- <NeuralOutputs numberOfOutputs="1">
- <NeuralOutput outputNeuron="9">
- <DerivedField optype="continuous" dataType="float">
- <NormContinuous field="yhat">
- <LinearNorm orig="0.000000e+000" norm="-5.873935e-001"/>
- <LinearNorm orig="7.781171e+001" norm="0.000000e+000"/>
- </NormContinuous>
- </DerivedField>
- </NeuralOutput>
- </NeuralOutputs>
- </NeuralNetwork>
-</PMML>
+++ /dev/null
-<?xml version="1.0"?>
-<PMML xmlns="http://www.dmg.org/PMML-4_1" version="4.1">
- <Header copyright="myCopyright" description="Tests unitaires">
- <Application name="PMMLlib" version="myVersion"/>
- <Annotation>Tests unitaires PMMLlib</Annotation>
- </Header>
- <DataDictionary>
- <DataField name="x6" displayName=" x_{6}" optype="continuous" dataType="double">
- <Interval closure="ClosedClosed" leftMargin="1.100000e+001" rightMargin="2.300000e+001"/>
- </DataField>
- <DataField name="x8" displayName=" x_{8}" optype="continuous" dataType="double">
- <Interval closure="ClosedClosed" leftMargin="2.810000e+001" rightMargin="7.670000e+001"/>
- </DataField>
- <DataField name="x1" displayName=" x_{1}" optype="continuous" dataType="double">
- <Interval closure="ClosedClosed" leftMargin="6.360000e+000" rightMargin="1.251000e+001"/>
- </DataField>
- </DataDictionary>
- <RegressionModel functionName="regression" modelName="Modeler[LinearRegression]Tds[steamplant]Predictor[x6:x8:x6x8:x6x6x8]Target[x1]" targetFieldName="x1">
- <MiningSchema>
- <MiningField name="x6" usageType="active"/>
- <MiningField name="x8" usageType="active"/>
- <MiningField name="x1" usageType="predicted"/>
- </MiningSchema>
- <RegressionTable intercept="3.837365e+000">
- <NumericPredictor name="x6" exponent="1" coefficient="4.759134e-001"/>
- <NumericPredictor name="x8" exponent="1" coefficient="1.428838e-001"/>
- <PredictorTerm coefficient="-2.201903e-002">
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- <PredictorTerm coefficient="5.362560e-004">
- <FieldRef field="x6"/>
- <FieldRef field="x6"/>
- <FieldRef field="x8"/>
- </PredictorTerm>
- </RegressionTable>
- </RegressionModel>
-</PMML>
IF(SALOME_BUILD_TESTS)
ADD_SUBDIRECTORY(Test)
- ADD_SUBDIRECTORY(pmml)
+ ADD_SUBDIRECTORY(pmml)
ENDIF(SALOME_BUILD_TESTS)
# --- options ---
SALOME_CONFIGURE_FILE(xmlrun_orig.sh xmlrun.sh)
ADD_TEST(NAME YacsLoaderTest COMMAND ${SHELL} YacsLoaderTest.sh)
ENDIF()
+
YACSBases
${CPPUNIT_LIBRARIES} ${PLATFORM_LIBS})
-ADD_TEST(TestYACSPMML TestYACSPMML)
-
INSTALL(TARGETS TestYACSPMML DESTINATION ${SALOME_INSTALL_BINS})
+
+IF(NOT WIN32)
+ SET(SHELL /bin/sh)
+ SALOME_CONFIGURE_FILE(config_appli.xml.in config_appli.xml)
+ SALOME_CONFIGURE_FILE(PmmlExeTest.sh.in PmmlExeTest.sh)
+ SALOME_CONFIGURE_FILE(PmmlInSessionTest.sh.in PmmlInSessionTest.sh)
+ ADD_TEST(NAME PmmlExeTest COMMAND ${SHELL} PmmlExeTest.sh)
+ENDIF()
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+# Copyright (C) 2006-2014 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+if test -f @CMAKE_CURRENT_BINARY_DIR@/config_appli.xml; then
+ if test -n "${GEOM_ROOT_DIR}" && test -d ${GEOM_ROOT_DIR}; then
+ sed -i s%\"GEOM_ROOT_DIR\"%\"${GEOM_ROOT_DIR}\"% @CMAKE_CURRENT_BINARY_DIR@/config_appli.xml
+ fi
+ if test -n "${PYHELLO_ROOT_DIR}" && test -d ${PYHELLO_ROOT_DIR}; then
+ sed -i s%\"PYHELLO_ROOT_DIR\"%\"${PYHELLO_ROOT_DIR}\"% @CMAKE_CURRENT_BINARY_DIR@/config_appli.xml
+ fi
+fi
+
+if test -f @KERNEL_ROOT_DIR@/bin/salome/appli_gen.py ; then
+
+ # --- create a SALOME Application environment
+
+ @KERNEL_ROOT_DIR@/bin/salome/appli_gen.py
+ sed -i s/\"yes\"/\"no\"/ SalomeApp.xml
+ sed -i s/\,study\,cppContainer\,registry\,moduleCatalog// SalomeApp.xml
+ sed -i s/pyContainer/pyContainer\,study\,cppContainer\,registry\,moduleCatalog/ SalomeApp.xml
+
+cat > CatalogResources.xml << EOF
+<!DOCTYPE ResourcesCatalog>
+<resources>
+ <machine hostname="localhost" />
+</resources>
+EOF
+
+ # ---------------------------------------------------------------------------
+ # --- first set of test in C++
+
+ # --- launch in background a SALOME session (servers)
+
+ ln -fs @CMAKE_SOURCE_DIR@/src/yacsloader/samples .
+ ./runAppli > log1 2>&1
+
+ # --- wait a little to let the background process define
+ # the CORBA naming service port and host
+
+ sleep 5
+
+ # --- execute the test script in SALOME session environment
+
+ chmod +x @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
+ ./runSession @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
+ ret=$?
+
+ # ---------------------------------------------------------------------------
+
+ kill -9 `cat "/tmp/YACSTEST_PidEcho"`
+ ./runSession killSalome.py
+
+ echo "exec status PmmlInSessionTest.sh " $ret
+
+ # --- delete all the SALOME Application environment
+
+ ./bin/salome/appli_clean.sh -f
+
+else
+
+ ln -fs @CMAKE_SOURCE_DIR@/src/yacsloader/samples .
+ chmod +x @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
+ @CMAKE_CURRENT_BINARY_DIR@/PmmlInSessionTest.sh
+ ret=$?
+ echo "exec status PmmlInSessionTest.sh " $ret
+
+fi
+
+if [ $ret -ne 0 ]
+then cat /tmp/${USER}/UnitTestsResult
+else echo "Results are in /tmp/${USER}/UnitTestsResult"
+fi
+
+exit $ret
--- /dev/null
+#!/bin/bash
+# Copyright (C) 2006-2014 CEA/DEN, EDF R&D
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# --- script to execute in SALOME environment (use runSession)
+
+# --- wait until SALOME containers are ready
+
+python @CMAKE_CURRENT_SOURCE_DIR@/waitContainers.py
+
+# --- launch CORBA server echoSrv for tests
+
+./echoSrv &
+pidecho=$!
+echo $pidecho > "/tmp/YACSTEST_PidEcho"
+
+# Environment variables needed for the optimizer loop tests
+export LD_LIBRARY_PATH=@CMAKE_CURRENT_BINARY_DIR@:$LD_LIBRARY_PATH
+export PYTHONPATH=@CMAKE_BINARY_DIR@/src/engine_swig:$PYTHONPATH
+export PYTHONPATH=@CMAKE_BINARY_DIR@/src/runtime_swig:$PYTHONPATH
+export PYTHONPATH=@CMAKE_CURRENT_SOURCE_DIR@:$PYTHONPATH
+
+# --- launch unit tests
+
+export ROOT_SAMPLES=@CMAKE_SOURCE_DIR@/src/yacsloader/samples
+export TESTCOMPONENT_ROOT_DIR=@CMAKE_BINARY_DIR@/src/runtime/Test
+
+./TestYACSPMML
+ret=$?
+echo "exec status TestYACSPMML " $ret
+
+# --- return unit tests status
+
+exit $ret
void YACSPMMLBasicsTest1::setUp()
{
-#ifdef WIN32
- const char* p = std::getenv("YACS_ROOT_DIR");
- std::string strP("");
- if (p)
- strP = std::string(p);
- else
- throw std::string("unable to get YACS_ROOT_DIR");
- resourcesDir = strP;
- resourcesDir += "/share/salome/yacssamples/";
-#else
- resourcesDir = getenv("YACS_ROOT_DIR");
- resourcesDir += "/share/salome/yacssamples/";
-#endif
+ resourcesDir = "samples/";
}
void YACSPMMLBasicsTest1::tearDown()
--- /dev/null
+<!--
+ Copyright (C) 2006-2014 CEA/DEN, EDF R&D
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+ See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+
+-->
+<application>
+<prerequisites path="profile@SALOMEYACS_VERSION@.sh"/>
+<modules>
+ <!-- variable name <MODULE>_ROOT_DIR is built with <MODULE> == name attribute value -->
+ <!-- <MODULE>_ROOT_DIR values is set with path attribute value -->
+ <!-- attribute gui (defaults = yes) indicates if the module has a gui interface -->
+ <module name="KERNEL" gui="no" path="@KERNEL_ROOT_DIR@"/>
+ <module name="GUI" gui="no" path="@GUI_ROOT_DIR@"/>
+ <module name="GEOM" path="GEOM_ROOT_DIR"/> <!--GEOM_ROOT_DIR will be substituted at starting of test-->
+ <module name="PYHELLO" path="PYHELLO_ROOT_DIR"/> <!--PYHELLO_ROOT_DIR will be substituted at starting of test-->
+ <module name="YACS" path="@CMAKE_INSTALL_PREFIX@"/>
+</modules>
+</application>
+