N-jobs=2

Hi,
In Exercise M2.01, when evaluating the generalization performance of the model by cross-validation with a ShuffleSplit schem, I see in the solution:
n-jobs=2

What does this code mean? When should I use this code?

Thank you in advance for your answer.
Claudine

1 Like

Hi Claudine,

Large problems can often be divided into smaller ones, which can then be solved at the same time. This is called parallel computing. The n_jobs parameters of certain estimators control the number of processes or threads assigned to make the parallel computation.

On the MOOC’s cloud the number of cores is limited, but you can play with that parameter when running scikit-learn locally.

2 Likes