When using the example for an "ExperimentRegistry" from the package vignette, the number of problems and algorithms is not correctly displayed when printing the registry object:
library(batchtools)
reg = makeExperimentRegistry(file.dir = NA, seed = 1)
subsample = function(data, job, ratio, ...) {
n = nrow(data)
train = sample(n, floor(n * ratio))
test = setdiff(seq_len(n), train)
list(test = test, train = train)
}
data("iris", package = "datasets")
addProblem(name = "iris", data = iris, fun = subsample, seed = 42)
svm.wrapper = function(data, job, instance, ...) {
library("e1071")
mod = svm(Species ~ ., data = data[instance$train, ], ...)
pred = predict(mod, newdata = data[instance$test, ], type = "class")
table(data$Species[instance$test], pred)
}
addAlgorithm(name = "svm", fun = svm.wrapper)
reg
returns:
Experiment Registry
Backend : Interactive
File dir : C:/...
Work dir : C:/...
Jobs : 0
Problems : 0
Algorithms: 0
Seed : 1
Writeable : TRUE
However, there is one problem and one algorithm defined, as can be checked by:
When using the example for an "ExperimentRegistry" from the package vignette, the number of problems and algorithms is not correctly displayed when printing the registry object:
returns:
However, there is one problem and one algorithm defined, as can be checked by:
Did I miss something or is this just a bug?