library(NNbenchmark)
library(kableExtra)
options(scipen = 999)
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
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(minpack.lm)
minpack.lm.method <- "none"
hyperParams.minpack.lm <- function(...) {
return (list(iter=maxit2ndorder))
}
NNtrain.minpack.lm <- function(x, y, dataxy, formula, neur, method, hyperParams, NNfullformula, NNparam, ...) {
hyper_params <- do.call(hyperParams, list(...))
minpack.lm::nlsLM(NNfullformula, data = dataxy,
control = list(maxiter = hyper_params$iter))
}
NNpredict.minpack.lm <- function(object, x, ...)
predict(object, newdata=as.data.frame(x))
NNclose.minpack.lm <- function()
if("package:minpack.lm" %in% search())
detach("package:minpack.lm", unload=TRUE)
minpack.lm.prepareZZ <- list(xdmv = "m", ydmv = "v", zdm = "d", scale = TRUE)
if(FALSE)
res <- trainPredict_1data(1, minpack.lm.method, "NNtrain.minpack.lm", "hyperParams.minpack.lm", "NNpredict.minpack.lm",
NNsummary, "NNclose.minpack.lm", NA, minpack.lm.prepareZZ, nrep=5,
echo=TRUE, doplot=FALSE, echoreport=0,
pkgname="minpack.lm", pkgfun="nlsLM", csvfile=TRUE, rdafile=TRUE, odir=odir)
res <- trainPredict_1pkg(1:12, pkgname = "minpack.lm", pkgfun = "nlsLM", minpack.lm.method,
prepareZZ.arg = minpack.lm.prepareZZ, nrep = nrep, doplot = TRUE,
csvfile = TRUE, rdafile = TRUE, odir = odir, echo = FALSE)
#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.6081 | 0.3698 | 0.4989 | 1.9776 | 0.23 |
mFriedman | 0.1269 | 0.0161 | 0.1009 | 0.3714 | 0.34 |
mIshigami | 2.5379 | 6.4408 | 2.0524 | 7.6035 | 0.86 |
mRef153 | 3.4318 | 11.7771 | 2.4646 | 13.2825 | 0.06 |
uDmod1 | 0.0445 | 0.0020 | 0.0362 | 0.1153 | 0.03 |
uDmod2 | 0.0427 | 0.0018 | 0.0333 | 0.1058 | 0.01 |
uDreyfus1 | 0.0000 | 0.0000 | 0.0000 | 0.0001 | 0.00 |
uDreyfus2 | 0.0906 | 0.0082 | 0.0723 | 0.2197 | 0.01 |
uGauss1 | 2.2329 | 4.9857 | 1.7383 | 6.9429 | 0.06 |
uGauss2 | 2.9795 | 8.8775 | 2.3890 | 9.0540 | 0.04 |
uGauss3 | 3.1472 | 9.9050 | 2.4837 | 9.7293 | 0.03 |
uNeuroOne | 1.2720 | 1.6181 | 1.1104 | 2.5150 | 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.6081 | 0.3698 | 0.4989 | 1.9776 | 0.240 |
mFriedman | 0.1269 | 0.0161 | 0.1009 | 0.3714 | 0.370 |
mIshigami | 2.5379 | 6.4408 | 2.0524 | 7.6035 | 0.870 |
mRef153 | 3.4318 | 11.7771 | 2.4646 | 13.2825 | 0.070 |
uDmod1 | 0.0445 | 0.0020 | 0.0362 | 0.1153 | 0.040 |
uDmod2 | 0.0427 | 0.0018 | 0.0333 | 0.1058 | 0.030 |
uDreyfus1 | 0.0000 | 0.0000 | 0.0000 | 0.0001 | 0.015 |
uDreyfus2 | 0.0906 | 0.0082 | 0.0723 | 0.2197 | 0.010 |
uGauss1 | 2.2329 | 4.9857 | 1.7383 | 6.9429 | 0.080 |
uGauss2 | 2.9795 | 8.8775 | 2.3890 | 9.0540 | 0.050 |
uGauss3 | 3.1472 | 9.9050 | 2.4837 | 9.7293 | 0.050 |
uNeuroOne | 1.2720 | 1.6181 | 1.1104 | 2.5150 | 0.000 |