1 Environment and datasets

1.1 Setup environment

library(NNbenchmark)
library(kableExtra)
options(scipen = 999)
if(dir.exists("D:/GSoC2020/Results/2020run02/"))
{  
  odir <- "D:/GSoC2020/Results/2020run02/"
}else if(dir.exists("~/Documents/recherche-enseignement/code/R/NNbenchmark-project/NNtempresult/"))
{  
  odir <- "~/Documents/recherche-enseignement/code/R/NNbenchmark-project/NNtempresult/"
}else
  odir <- "~"

nrep <- 10
maxit2ndorder  <-    200
maxit1storderA <-   1000
maxit1storderB <-   5000
maxit1storderC <-  10000
maxit1storderD <- 100000

1.2 Datasets to test

NNdataSummary(NNdatasets)
##      Dataset n_rows n_inputs n_neurons n_parameters
## 1     mDette    500        3         5           26
## 2  mFriedman    500        5         5           36
## 3  mIshigami    500        3        10           51
## 4    mRef153    153        5         3           22
## 5     uDmod1     51        1         6           19
## 6     uDmod2     51        1         5           16
## 7  uDreyfus1     51        1         3           10
## 8  uDreyfus2     51        1         3           10
## 9    uGauss1    250        1         5           16
## 10   uGauss2    250        1         4           13
## 11   uGauss3    250        1         4           13
## 12 uNeuroOne     51        1         2            7

2 Dedicated functions by packages

2.1 yager Train/predict Function - arguments x,y

#library(yager)
yager.method <- "none"
hyperParams.yager <- function(optim_method, ...) {
    return (list(sigma = 0.15))
}
NNtrain.yager <- function(x, y, dataxy, formula, neur, optim_method, hyperParams,...) {
    
    hyper_params <- do.call(hyperParams.yager, list(yager.method))
    sigma <- hyper_params$sigma
    
    NNreg <- yager::grnn.fit(x = x, y = y, sigma = sigma)
    return (NNreg)
}
NNpredict.yager <- function(object, x, ...)
    yager::grnn.predict(object, x)
NNclose.yager <- function()
  if("package:yager" %in% search())
    detach("package:yager", unload=TRUE)
yager.prepareZZ <- list(xdmv = "m", ydmv = "v", zdm = "d", scale = TRUE)
if(FALSE)
res <- trainPredict_1data(1, yager.method, "NNtrain.yager", "hyperParams.yager", "NNpredict.yager", 
                               NNsummary, "NNclose.yager", NA, yager.prepareZZ, nrep=5, echo=TRUE, doplot=FALSE,
                               pkgname="yager", pkgfun="yager", csvfile=TRUE, rdafile=TRUE, odir=odir)
if(FALSE)
res <- trainPredict_1mth1data(1, yager.method[1], "NNtrain.yager", "hyperParams.yager", "NNpredict.yager", 
                               NNsummary, yager.prepareZZ, nrep=5, echo=TRUE, doplot=FALSE,
                               pkgname="yager", pkgfun="yager", csvfile=TRUE, rdafile=TRUE, odir=odir)

3 Launch the NN package

res <- trainPredict_1pkg(1:2, pkgname = "yager", pkgfun = "grnn.fit", yager.method,
  prepareZZ.arg = yager.prepareZZ, nrep = nrep, doplot = TRUE,
  csvfile = TRUE, rdafile = TRUE, odir = odir, echo = FALSE)

4 Results

#print(res)
kable(t(apply(res, c(1,4), min)))%>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
RMSE MSE MAE WAE time
mDette 0.4741 0.2248 0.3193 1.9227 0.98
mFriedman 0.0001 0.0000 0.0000 0.0010 1.00
mIshigami 0.3204 0.1027 0.2356 1.2542 0.99
mRef153 1.3399 1.7954 0.6881 7.4019 0.07
uDmod1 0.1503 0.0226 0.1139 0.4593 0.00
uDmod2 0.1091 0.0119 0.0874 0.2767 0.00
uDreyfus1 0.1242 0.0154 0.0753 0.3660 0.00
uDreyfus2 0.1537 0.0236 0.1102 0.5258 0.00
uGauss1 7.3522 54.0553 5.8564 20.1216 0.20
uGauss2 6.2819 39.4624 4.8291 16.7456 0.20
uGauss3 5.1689 26.7180 4.0100 15.5364 0.20
uNeuroOne 0.3110 0.0967 0.2456 0.7642 0.00
kable(t(apply(res, c(1,4), median)))%>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
RMSE MSE MAE WAE time
mDette 0.4741 0.2248 0.3193 1.9227 1.000
mFriedman 0.0001 0.0000 0.0000 0.0010 1.015
mIshigami 0.3204 0.1027 0.2356 1.2542 1.010
mRef153 1.3399 1.7954 0.6881 7.4019 0.090
uDmod1 0.1503 0.0226 0.1139 0.4593 0.015
uDmod2 0.1091 0.0119 0.0874 0.2767 0.015
uDreyfus1 0.1242 0.0154 0.0753 0.3660 0.020
uDreyfus2 0.1537 0.0236 0.1102 0.5258 0.015
uGauss1 7.3522 54.0553 5.8564 20.1216 0.215
uGauss2 6.2819 39.4624 4.8291 16.7456 0.220
uGauss3 5.1689 26.7180 4.0100 15.5364 0.200
uNeuroOne 0.3110 0.0967 0.2456 0.7642 0.020