ParBayesianOptimization
ParBayesianOptimization copied to clipboard
Recursive Argument fix
Hey @AnotherSamWilson and @kapsner, really appreciate your work. An average user can run into the “promise already under evaluation” error when a default argument references itself:
iterations = 100
scoringFunction = function(x, iterations = iterations) {
score = x^iterations
list(Score = score)
}
bounds = list(x = c(0, 1))
bayes = bayesOpt(scoringFunction, bounds = bounds, initPoints = 10)
# errorMessage --> "promise already under evaluation: recursive default argument reference or earlier problems?"
# afterwards e.g. build better model
print(scoringFunction(x = 0, iterations = 200))
With this in place, the example above now just works fine and all existing unit tests still pass.