Control the parallelism via threading while calling external packages from mlr3.
For example, the random forest implementation in package ranger (connected
via mlr3learners) supports threading via OpenMP.
The number of threads to use can be set via hyperparameter
defaults to 1. By calling
set_threads(x, 4) with
x being a ranger learner, the
hyperparameter is changed so that 4 cores are used.
If the object
x does not support threading,
x is returned as-is.
If applied to a list, recurses through all list elements.
Note that threading is incompatible with other parallelization techniques such as forking via the future::plan future::multicore. For this reason all learners connected to mlr3 have threading disabled in their defaults.
1 2 3 4 5 6 7 8 9 10
Same object as input
x (changed in-place),
with possibly updated parameter values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.