Is there a limitation of n_jobs in Scikit Learn GridSearchCV where it must be less than the number of cv folds?

Viewed 116

I'm running a GridSearchCV on a hpc cluster with 64 cores available. I'm using 10 cv folds and n_jobs=40:

param_grid = [{'n_estimators': list(range(20, 200, 20)), 'criterion': ['mse', 'mae']}]
regcv = model_selection.GridSearchCV(RandomForestRegressor(), param_grid, cv=10, n_jobs=40, verbose=1)
regcv.fit(train , labels)

I have noticed that there is only 10 processes running on my cluster even tho I've stipulated 40. I've also tried running the GridSearchCV with n_jobs=20 and again there are only 10 processes running on my cluster.

Is it possible to have more n_jobs than cv folds?

0 Answers
Related