makeExperimentRegistry
constructs a special Registry
which
is suitable for the definition of large scale computer experiments.
Each experiments consists of a Problem
and an Algorithm
.
These can be parametrized with addExperiments
to actually define computational
jobs.
makeExperimentRegistry( file.dir = "registry", work.dir = getwd(), conf.file = findConfFile(), packages = character(0L), namespaces = character(0L), source = character(0L), load = character(0L), seed = NULL, make.default = TRUE )
file.dir | [ If you pass |
---|---|
work.dir | [ The provided path will get normalized unless it is given relative to the home directory (i.e., starting with “~”). Note that some templates do not handle relative paths well. |
conf.file | [ The file lookup is implemented in the internal (but exported) function
Set to |
packages | [ |
namespaces | [ |
source | [ |
load | [ |
seed | [ |
make.default | [ |
[ExperimentRegistry
].
batchtools:::example_push_temp(1) tmp = makeExperimentRegistry(file.dir = NA, make.default = FALSE)#>#># Definde one problem, two algorithms and add them with some parameters: addProblem(reg = tmp, "p1", fun = function(job, data, n, mean, sd, ...) rnorm(n, mean = mean, sd = sd))#>#>#>#>#># Overview over defined experiments: tmp$problems#> [1] "p1"tmp$algorithms#> [1] "a1" "a2"#> problem algorithm .count #> 1: p1 a1 40 #> 2: p1 a2 40#> problem algorithm n .count #> 1: p1 a1 50 20 #> 2: p1 a1 100 20 #> 3: p1 a2 50 20 #> 4: p1 a2 100 20#> job.id problem algorithm n mean sd #> 1: 1 p1 a1 50 -2 1 #> 2: 2 p1 a1 50 -2 2 #> 3: 3 p1 a1 50 -2 3 #> 4: 4 p1 a1 50 -2 4 #> 5: 5 p1 a1 50 -1 1 #> 6: 6 p1 a1 50 -1 2 #> 7: 7 p1 a1 50 -1 3 #> 8: 8 p1 a1 50 -1 4 #> 9: 9 p1 a1 50 0 1 #> 10: 10 p1 a1 50 0 2 #> 11: 11 p1 a1 50 0 3 #> 12: 12 p1 a1 50 0 4 #> 13: 13 p1 a1 50 1 1 #> 14: 14 p1 a1 50 1 2 #> 15: 15 p1 a1 50 1 3 #> 16: 16 p1 a1 50 1 4 #> 17: 17 p1 a1 50 2 1 #> 18: 18 p1 a1 50 2 2 #> 19: 19 p1 a1 50 2 3 #> 20: 20 p1 a1 50 2 4 #> 21: 41 p1 a2 50 -2 1 #> 22: 42 p1 a2 50 -2 2 #> 23: 43 p1 a2 50 -2 3 #> 24: 44 p1 a2 50 -2 4 #> 25: 45 p1 a2 50 -1 1 #> 26: 46 p1 a2 50 -1 2 #> 27: 47 p1 a2 50 -1 3 #> 28: 48 p1 a2 50 -1 4 #> 29: 49 p1 a2 50 0 1 #> 30: 50 p1 a2 50 0 2 #> 31: 51 p1 a2 50 0 3 #> 32: 52 p1 a2 50 0 4 #> 33: 53 p1 a2 50 1 1 #> 34: 54 p1 a2 50 1 2 #> 35: 55 p1 a2 50 1 3 #> 36: 56 p1 a2 50 1 4 #> 37: 57 p1 a2 50 2 1 #> 38: 58 p1 a2 50 2 2 #> 39: 59 p1 a2 50 2 3 #> 40: 60 p1 a2 50 2 4 #> job.id problem algorithm n mean sd#>#> [1] TRUE# Reduce the results of algorithm a1 ids.mean = findExperiments(algo.name = "a1", reg = tmp) reduceResults(ids.mean, fun = function(aggr, res, ...) c(aggr, res), reg = tmp)#> [1] -2.00073766 -1.83988515 -2.19491590 -1.88744748 -1.16661898 -1.01586977 #> [7] -0.52913619 -0.63585094 -0.09331735 0.11880843 0.22120996 1.22939842 #> [13] 1.00632897 1.26918801 2.11616673 1.81935795 1.90243597 1.93950861 #> [19] 2.33621891 2.81313094 -1.95745534 -2.29431806 -1.82269005 -1.80889629 #> [25] -0.91933173 -1.03820621 -0.95531362 -1.49309041 0.09203207 0.05360571 #> [31] 0.04219920 -0.11534443 1.14488890 0.83504259 0.82821428 1.07835718 #> [37] 2.06274541 2.28296085 2.26426388 1.74159301# Join info table with all results and calculate mean of results # grouped by n and algorithm ids = findDone(reg = tmp) pars = unwrap(getJobPars(ids, reg = tmp)) results = unwrap(reduceResultsDataTable(ids, fun = function(res) list(res = res), reg = tmp)) tab = ljoin(pars, results) tab[, list(mres = mean(res)), by = c("n", "algorithm")]#> n algorithm mres #> 1: 50 a1 0.270398674 #> 2: 100 a1 0.001062847 #> 3: 50 a2 0.068935673 #> 4: 100 a2 0.020262158