Connecting to YModelCli from esProc

Read(440) Label: esproc, connect,

Follow these instructions to use YModelCli external library files in esProc:

1. Under YModelCli, the external library directory in YModel installation directory, and in YModel’s class path (installation root directory\YModel\lib), find files YModel external library needs and copy them to esProc directory (installation root directory\esProc\extlib\YModelCli).

The YModelCli folder under YModel installation directory contains a series of jar files and an xml file:

ant-1.8.2.jar

commons-beanutils-2.10.jar

commons-lang-2.6.jar

ezmorph-1.0.2.jar

json-lib-1.1-jdk13.jar

scu-ymodel-cli-2.10.jar

userconfig.xml

Among which scu-ymodel-cli-2.10.jar is the core jar file.

YModel’s class path (installation root directory\YModel\lib) contains the following jar files:

commons-io-2.4.jar

esproc-ent-xxxxxxxx.jar

esproc-ext-xxxxxxxx.jar

fastjson-1.2.49.jar

gson-2.8.0.jar

jackson-annotations-2.9.6.jar

jackson-core-2.9.6.jar

jackson-databind-2.9.6.jar

jackson-dataformat-msgpack-0.8.14.jar

mining.jar

msgpack-0.6.12.jar

msgpack-core-0.8.16.jar

Note: Users can choose appropriate ones from these third-party jars for specific scenarios.

2. Configure related parameters in userconfig.xml under esProc installation directory\esProc\extlib\YModelCli directory:

<?xml version="1.0" encoding="UTF-8"?>

<Config Version="1">

<Options>

<!-- YModel application directory -->

<Option Name="sAppHome" Value=""/>

<!-- Python path under YModel installation directory --> 

<Option Name="sPythonHome" Value=""/>

<!—Python service network port-->

<Option Name="iPythonServerPort" Value="8510"/>

<!— Number of Python processes -->

<Option Name="iPythonProcessNumber" Value="2"/>

<!--Automatically impute or not --> 

<Option Name="bAutoDecideImpute" Value="true"/>

<!--Number of resamplings --> 

<Option Name="iResampleMultiple" Value="150"/>

</Options>

</Config>

The configuration of sPythonHome varies under Windows and under Linux. The configuration path for Windows is [sAppHome]/Python39/python.exe, and that for Linux is [sAppHome]/Python39/bin/python3.9.

3. Configure external library directory on esProc designer

Click Tool -> Options -> Environment on the menu bar and access the following interface:

Click Browse button after External library directory to select an external library, as shown below:

 

Click Select button to select the directory where the YModelClic external library settles and click OK button. Then restart IDE to make the configuration take effect.

Note:

1) Users can define name and path of the external library folder. It would be better not to select a directory having too many subdirectories as the external library directory so that the file loading efficiency won’t affected. And do not put jar files of different external libraries under same directory in order to prevent errors resulted from jar collisions.

2) When executing a dfx file from the command line on a non-GUI interface, you can change the configuration file under installation root directory/esProc/config/raqsoftConfig.xml manually and add an external library direction:

<Esproc>

      … …

    // Configure path of external library folder

  <extLibsPath>D:\raqsoft\esProc\extlib</extLibsPath>

  <importLibs>

//Configure name of external library folder

      <lib>YModelCli</lib>

  </importLibs>

</Esproc>

4. esProc offers a series of external library functions for using YModel prediction functionality. They include ym_env(), ym_model(), ym_target(), ym_build_model(), ym_result(), ym_close(), etc. Find their uses in Function Reference.