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 <- 5
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 GMDHreg Train/predict Function - arguments x,y

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

3 Launch the NN package

res <- trainPredict_1pkg(1:4, pkgname = "GMDHreg", pkgfun = "gmdh.combi", GMDHreg.method,
  prepareZZ.arg = GMDHreg.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 2.1304 4.5385 1.7081 8.6036 0.08
mFriedman 0.0933 0.0087 0.0763 0.2012 406.69
mIshigami 3.3094 10.9522 2.6424 11.9489 0.09
mRef153 4.5327 20.5458 3.5416 13.5408 227.29
kable(t(apply(res, c(1,4), median)))%>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
RMSE MSE MAE WAE time
mDette 2.1304 4.5385 1.7081 8.6036 0.10
mFriedman 0.0933 0.0087 0.0763 0.2012 407.54
mIshigami 3.3094 10.9522 2.6424 11.9489 0.09
mRef153 4.5327 20.5458 3.5416 13.5408 230.67