1 Setup

1.1 Packages and options

library(NNbenchmark)
library(kableExtra)
options(scipen = 999)

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

1.3 traineR trainPredict arguments - inputs fmla, data

if(dir.exists("D:/GSoC2020/Results/2020run03/"))
{  
  odir <- "D:/GSoC2020/Results/2020run03/"
}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 <-  10000
maxit1storderC <- 100000

#library(traineR)
traineR.method <- "none"
hyperParams.traineR <- function(...) {
    return (list(iter=maxit2ndorder))
}
NNtrain.traineR <- function(x, y, dataxy, formula, neur, method, hyperParams, ...) {
  hyper_params <- do.call(hyperParams, list(...))
  NNreg <- traineR::train.nnet(formula = formula, data = dataxy, size = neur, maxit = hyper_params$iter, linout = TRUE)
  return(NNreg)
}
NNpredict.traineR <- function(object, x, dataxy, ...){
  object$fitted.values 
}
NNclose.traineR <- function()
  if("package:traineR" %in% search())
    detach("package:traineR", unload=TRUE)
traineR.prepareZZ <- list(xdmv = "d", ydmv = "v", zdm = "d", scale = TRUE)
if(FALSE)
res <- trainPredict_1data(1, traineR.method, "NNtrain.traineR", "hyperParams.traineR", "NNpredict.traineR", 
                               NNsummary, "NNclose.traineR", NA, traineR.prepareZZ, nrep=5, echo=TRUE, doplot=FALSE,
                               pkgname="traineR", pkgfun="traineR", csvfile=TRUE, rdafile=TRUE, odir=odir)

2 Launch package’s trainPredict

res <- trainPredict_1pkg(1:12, pkgname = "traineR", pkgfun = "train.nnet", traineR.method,
  prepareZZ.arg = traineR.prepareZZ, nrep = nrep, doplot = TRUE,
  csvfile = TRUE, rdafile = TRUE, odir = odir, echo = FALSE)

3 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.2967 0.0880 0.2297 1.3034 0.06
mFriedman 0.0112 0.0001 0.0088 0.0371 0.07
mIshigami 0.5910 0.3493 0.4477 2.8272 0.12
mRef153 3.2252 10.4016 2.1861 12.3903 0.00
uDmod1 0.0436 0.0019 0.0352 0.1090 0.00
uDmod2 0.0427 0.0018 0.0330 0.1042 0.00
uDreyfus1 0.0022 0.0000 0.0015 0.0068 0.00
uDreyfus2 0.0906 0.0082 0.0724 0.2199 0.00
uGauss1 2.2350 4.9951 1.7379 6.9523 0.03
uGauss2 2.3663 5.5993 1.8601 7.4004 0.01
uGauss3 2.2994 5.2872 1.8319 6.4072 0.00
uNeuroOne 0.2830 0.0801 0.2313 0.5674 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.48980 0.24035 0.36425 2.32880 0.080
mFriedman 0.08065 0.00655 0.07325 0.15530 0.100
mIshigami 1.28565 1.95540 0.98775 4.31375 0.140
mRef153 3.52975 12.46025 2.57410 14.53150 0.015
uDmod1 0.07420 0.00575 0.05575 0.22025 0.005
uDmod2 0.05990 0.00360 0.04825 0.13250 0.000
uDreyfus1 0.00340 0.00000 0.00270 0.01045 0.000
uDreyfus2 0.09060 0.00820 0.07240 0.22015 0.000
uGauss1 2.58120 6.67275 2.03685 8.17910 0.030
uGauss2 2.58170 6.66535 2.06355 7.88280 0.025
uGauss3 3.48485 12.14445 2.77020 10.57610 0.025
uNeuroOne 0.28300 0.08010 0.23130 0.56750 0.000