ECAST Summary Benchmark Tool for forecast automation and comparison of forecast systems aka cores 1 Installation • Requirements: Windows OS with Oracle Database, tested with Oracle 11g • Maven and dependent libraries • Download framework ressources from website http://wwwdb.inf.tu-dresden.de/research-projects/projects/reef/ • It contains: ◦ Installation files for ECAST Project: ECAST Execution Framework ◦ Two open source cores: OpenForecast and Mirabel ◦ SQL scripts for setup of tables and user 1.1 Setup of ECAST execution framework • Unzip the downloaded ecast-core-db.zip • Execute setup.bat. If there are dependencies that Maven cannot meet, check them and add them manually, for instance mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.2.0 -Dpackaging=jar -Dfile=lib/ojdbc6.jar -DgeneratePom=true com.oracle.ojdbc6:jar • Maven add an archive ecast-core-db-0.2-SNAPSHOT.jar that is the base of your Benchmark Tool 1.2 Database entries • Download and unzip db-objects.zip • Open and configure 00_Skript.bat to access your database ◦ Enter the system user and password ◦ Make sure the system can resolve your data base • Double-check 00_CreateECast.sql. For convenience, create a new user "ECAST" as proposed. If not possible, than you must change all SQL imports because they belong to this namespace • Execute 00_Skript.bat and check that there are no errors in the execution: scroll up and check that every table has been correctly imported or print the results to a file. Normally, this should be fine! 1.3 Use ECAST execution framework • Within main directory ecast-core-db, you need to create ◦ application-configuration.xml for database connection, see sample file ▪ The username is ecast if you created it, cf. section 1.2 ◦ models-configuration.xml for configuring a model, see sample file ▪ Enter your timeseries, normally they are placed in the "datafiles" directory ▪ Enter your core aliases and other configurations, cf. Schnittstellenbeschreibung.pdf 1.4 Execution of framework • Now you can check that the ECAST framework is working correctly • Start run_model_creator.bat: this creates a model query within your database for every core and every configuration • Start run_forecast.bat: now the queries are executed and you will find the results in "reusults" directory as well as in the ECAST.RESULT tables in your database 2 Integration of own core 2.1 General remarks • You can add any core on your own to compare them with the out-of-the-box cores from ECAST. It requires your core to include a wrapper that implements the ICalculator interface, cf. source files • Build a Java wrapper that implements ICalculator to your core algorithm and create a jar archive. The best way is to compare it with wrappers that exist already (RCalculator, OpenForecastCalculator). ICalculator takes a class ModelConfiguration for input variables, you should implement it in your wrapper • Put the jar archive into /lib/cores of the execution framework • Register core in REF_CORE table: ◦ ID_REF_CORE = unique id (integer) for this entry ◦ ALIAS = the alias string of your algorithm as used in models-configuration.xml. It cannot begin with "R_" because this implies a wrapper for R scripts ◦ FILENAME = the name string of your jar archive (without version and ".jar" extension) ◦ VERSION = the version string of your jar archive. Example: FILENAME = 'openforecast' and VERSION = '2.0' looks for a jar archive "openforecast-2.0.jar". Version is optional, you can leave it NULL, that means "openforecast.jar" ◦ INTERFACECLASS = the class of your wrapper with full path. Example: de.ecast.db.calculate.core.RCalculator • If external classes (*.jar) are necessary create one entry in table REF_CORE_LIB for each jar archive and for each core: ◦ ID_REF_CORE_LIB = unique id (integer) for this entry ◦ ALIAS = the alias (string) of your algorithm as used in models-configuration.xml ◦ LIB = name (string) of jar archive without ".jar" extension. Example: 'commons-io-1.3.2' includes lib/cores/commons-io-1.3.2.jar 2.2 Java to R Bridge • • Requirements: Install R binaries (v3.1.0 tested) for Windows from cran.r-project.org for your architecture (32bit or 64bit) Install library rJava as root: install.packages(rJava) • Make sure that jvm.dll from Java (1.4.0 and higher) can be resolved from your PATH variable, if not add it (usually, add C:\Program Files\Java\jre<Version>\bin\server) • Make sure that jri.dll for your architecture can be resolved. Usually, add C:\Program Files\R\R-<Version>\library\rJava\jri\<architecture> • Make sure that R.dll for your architecture can be resolved. Usually, add C:\Program Files\R\R-<Version>\bin\<architecture> • Download and unzip RWrapper.zip from the project homepage. It contains: ◦ JRI.jar, JRIEngine.jar, REngine.jar - libraries from Java to R Bridge ◦ RWrapper.jar - Wrapper for ECAST execution framework ◦ R_ets.R - R sample file • Put all those file into lib/cores • In models-configuration.xml, add the alias as a core name, for instance "R_ets". The R script file should be placed in /lib/cores and is named: <Filename>-<Version>.r • Add the following row in table REF_CORE: ◦ ALIAS = 'R_ets' (your algorithm name must begin with "R_") ◦ FILENAME = 'R_ets' (your algorithm name must begin with "R_") ◦ VERSION = null ◦ INTERFACECLASS = null • Register the following libraries in REF_CORE_LIB: ◦ INSERT INTO REF_CORE_LIB VALUES (<Id>,'R', 'JRI') ◦ INSERT INTO REF_CORE_LIB VALUES (<Id>,'R', 'JRIEngine') ◦ INSERT INTO REF_CORE_LIB VALUES (<Id>,'R', 'REngine') • The libraries must be registered only once, all R_<Script>.r scripts can use them • Finally test your script by running run_model_creator.bat and run_forecast.bat 2.3 Add Mirabel core • Unzip Mirabel-2.0.zip and put all files into /lib/cores. • Make sure that you install the libraries that fit your system architecture. If you use 32 bit, replace the dll with those from lib.zip win32/. Libraries for 64 bit are given. • Add the following row in table REF_CORE: ◦ ALIAS = mirabel ◦ FILENAME = mirabel ◦ VERSION = '2.0' ◦ INTERFACECLASS = de.ecast.db.calculate.core.MirabelCalculator • Add <Path Execution Framework>/lib/cores to your PATH variable • Execute system by testing Mirabel core 3 Core parameters • You can add all parameters that concern you core to REF_CORE_PARAMETER: ◦ ID_REF_CORE_PARAMETER = unique id (integer) ◦ NAME = alias (string) of your core ◦ KEY = key (string) of your parameter ◦ VALUE = value (string) of your parameter. • Those parameters are transmitted to your core via ModelConfiguration.coreParameters. • For R script: coreParameters are split in coreParametersKeys and coreParametersValues. Please take care of correctly evaluating them in your script!