r/rstats • • 3d ago

Preferred libraries for Bayesian Optimization

I've been trying to move a Bayesian optimization setup I made in Python via Scikit Learn & Optuna over to R and I found a couple different ways to do it.

The first results I found were tutorials using caret and rBayesianOptimization packages. Upon digging further I found out about Tidymodels and the whole system with Parsnip + Dials seems to be similar to what I was using and more recently updated.

Wanted to ask if there was a significant difference in performance between these different Bayesian optimization methods, and if there is a package I haven't found yet that I really should be using for this. My guess is that I'm overthinking it and that if I like Tidyverse then I should use Tidymodels.

The specific models I'm optimizing are survival or time-to-event models. I initially made these via scikit-survival + lifelines but I've been moving to the survival + ranger R packages so I can run them with the MICE multiple imputation package.

12 Upvotes

7 comments sorted by

6

u/Mooks79 3d ago

You could also look at mlr3, which is a metaverse of modelling tools like tidymodels but using a more sklearn style syntax / paradigm, which may feel more natural to you.

4

u/PandaJunk 3d ago

Rather than Bayesian optimization, have you considered just regular optimization with something like JAX? Or something from the Julia ecosystem? For problems with no good priors, that may be a way to get a good enough solution without going full Bayes. Or could even be used as a first step towards full Bayes.

1

u/0rangetree_ 3d ago

mlr3mbo does what you want

1

u/si_wo 1d ago

I like BayesianTools which is an mcmc solver

1

u/Junior_Bee7274 1d ago

I'd stick with what you're comfortable with. No need to overcomplicate things unless you're seeing actual performance issues.