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 radiant.model trainPredict arguments - inputs “y”, 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(radiant.model)
radiant.model.method <- "none"
hyperParams.radiant.model <- function(...) {
    return (list(type="regression", decay=0))
}
NNtrain.radiant.model <- function(x, y, dataxy, formula, neur, method, hyperParams, ...) {
    
    hyper_params <- do.call(hyperParams, list(...))
    
    radiant.model::nn(dataxy, rvar = "y", evar = attr(terms(formula), "term.labels"),
                      type = hyper_params$type, size = neur, 
                      decay = hyper_params$decay)
    
}
NNpredict.radiant.model <- function(object, x, ...)
   predict(object, pred_data=as.data.frame(x))$Prediction
NNclose.radiant.model <- function()
  if("package:radiant.model" %in% search())
    detach("package:radiant.model", unload=TRUE)
radiant.model.prepareZZ <- list(xdmv = "m", ydmv = "m", zdm = "d", scale = TRUE)
if(FALSE)
res <- trainPredict_1data(1, radiant.model.method, "NNtrain.radiant.model", "hyperParams.radiant.model", "NNpredict.radiant.model", 
                               NNsummary, "NNclose.radiant.model", NA, radiant.model.prepareZZ, nrep=5,
                               echo=TRUE, doplot=FALSE, echoreport=0,
                               pkgname="radiant.model", pkgfun="nn", csvfile=TRUE, rdafile=TRUE, odir=odir)

2 Launch package’s trainPredict

res <- trainPredict_1pkg(1:12, pkgname = "radiant.model", pkgfun = "nn", radiant.model.method,
  prepareZZ.arg = radiant.model.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.0798 0.0064 0.0639 0.3276 0.21
mFriedman 0.0040 0.0000 0.0032 0.0121 0.18
mIshigami 0.4621 0.2135 0.3422 2.5284 0.54
mRef153 3.1213 9.7426 2.1178 13.5535 0.03
uDmod1 0.0402 0.0016 0.0307 0.1061 0.03
uDmod2 0.0406 0.0016 0.0323 0.1008 0.03
uDreyfus1 0.0042 0.0000 0.0032 0.0115 0.01
uDreyfus2 0.0906 0.0082 0.0723 0.2197 0.02
uGauss1 2.2322 4.9826 1.7269 6.9968 0.04
uGauss2 2.3387 5.4697 1.8352 7.3628 0.04
uGauss3 2.2803 5.1998 1.8092 6.4791 0.03
uNeuroOne 0.2830 0.0801 0.2313 0.5672 0.01
kable(t(apply(res, c(1,4), median)))%>%
  kable_styling(bootstrap_options = c("striped", "hover", "condensed"))
RMSE MSE MAE WAE time
mDette 0.13810 0.02120 0.11180 0.75205 1.200
mFriedman 0.00840 0.00005 0.00640 0.02495 0.830
mIshigami 0.61065 0.37290 0.46555 2.72710 0.905
mRef153 3.22500 10.40085 2.21105 13.96895 0.045
uDmod1 0.04600 0.00215 0.03730 0.12335 0.055
uDmod2 0.05000 0.00255 0.04020 0.11745 0.030
uDreyfus1 0.00455 0.00000 0.00355 0.01405 0.025
uDreyfus2 0.09060 0.00820 0.07235 0.21990 0.030
uGauss1 2.47465 6.14515 1.94010 7.79830 0.140
uGauss2 3.26640 11.16265 2.59170 9.50580 0.090
uGauss3 3.14690 9.90285 2.48520 9.70455 0.080
uNeuroOne 0.28300 0.08010 0.23130 0.56745 0.020