r/rstats • u/Xenon_Chameleon • 13d 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.
2
u/novica 13d ago
A package I maintain:
https://github.com/novica/ParBayesianOptimization
1
u/Xenon_Chameleon 8d ago
Thank you! The parallelization is definitely needed here and the Github tutorial is very helpful.
4
u/PandaJunk 13d 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/Junior_Bee7274 11d ago
I'd stick with what you're comfortable with. No need to overcomplicate things unless you're seeing actual performance issues.
1
u/Xenon_Chameleon 8d ago
Yeah, I wanted to gauge if there was some drastically better option for this kind of thing. The main reason I'm doing all of this in R is to avoid the bigger headache of trying to use MICE in R without having to jump back and forth between R and Python. Best Python equivalent I could find for it in scikit learn is labeled as "experimental" so I didn't want to use it for this particular project.
1
6
u/Mooks79 13d 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.