## 5.1 Parallelization

Parallelization refers to the process of running multiple jobs in parallel, simultaneously. This process allows for significant savings in computing power.

mlr3 uses the future backends for parallelization. Make sure you have installed the required packages future and future.apply:

mlr3 is capable of parallelizing a variety of different scenarios. One of the most used cases is to parallelize the Resampling iterations. See Section Resampling for a detailed introduction to resampling.

In the following section, we will use the spam task and a simple classification tree ("classif.rpart") to showcase parallelization. We use the future package to parallelize the resampling by selecting a backend via the function future::plan(). We use the future::multiprocess backend here which uses forks (c.f. parallel::mcparallel()) on UNIX based systems and a socket cluster on Windows or if running in RStudio:

future::plan("multiprocess")

learner = lrn("classif.rpart")
resampling = rsmp("subsampling")

time = Sys.time()
Sys.time() - time
By default all CPUs of your machine are used unless you specify argument workers in future::plan().