mlr-org / mlrMBO

Toolbox for Bayesian Optimization and Model-Based Optimization in R
https://mlrmbo.mlr-org.com
Other
187 stars 47 forks source link

allow impute function to set extras attribute #497

Open mb706 opened 4 years ago

mb706 commented 4 years ago

Allow things like

makeMBOControl(
    impute.y.fun = function(x, y, opt.path, ...) {
      structure(-log(1/4), extras = list(metainfo = 2))  # log loss of dumbest possible prediction for 4 classes (i.e. nucleotide prediction)
    }, ...
)

otherwise, setting extras attribute in the actual function gives an error whenever a value is imputed, since opt.path doesn't allow points to have missing "extra(s)" for individual points.

jakob-r commented 4 years ago

Would you include that in a test? Does not have to be a new one. You could just add the extras into an existing one.

mb706 commented 4 years ago

I will do this when I get around to it

mb706 commented 1 year ago

@jakob-r this has tests now, you can merge it when / if you are making a new release for CRAN...