n_jobs parameter for random forest to select all but one/two of the processors

Question:

I would like to set the n_jobs parameter to as close to -1 but not include all processors. If we are using a 16VCPU machine, would this be equivalent to selecting n_jobs to 15? What if we want to select all CPUS but two of the processors? n_jobs = 14?

Asked By: veg2020

||

Answers:

From https://scikit-learn.org/stable/glossary.html#term-n-jobs:

For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. For example with n_jobs=-2, all CPUs but one are used.

Answered By: dx2-66