Is number of tasks same as the number of fits for GridSearchCV Logistic Regression?

259 views Asked by At

I am training a Logistic Regression model with GridSearchCV. The log says:

Fitting 3 folds for each of 1600 candidates, totalling 4800 fits

Further, for tasks below line in printed in log:

[Parallel(n_jobs=-1)]: Done 42 tasks | elapsed: 2.9min

Is the number of tasks here(like 42 tasks as above) same as the number of fits(=4800)?

I want to estimate the time taken to finish the training?

1

There are 1 answers

0
Akhil Jain On

Deciphering it step by step

Fitting 3 folds for each of 1600 candidates, totaling 4800 fits

  1. 1600 candidates means you are trying out 1600 combinations
  2. Fitting 3 folds means you specified cv=3, you are cross-validating 3 times on training data.
  3. totaling 4800 fits = 1600 * 3. i.e we have 4800 tasks

[Parallel(n_jobs=-1)]: Done 42 tasks | elapsed: 2.9min

  1. Parallel(n_jobs=-1), -1 means you are running on all cores of your CPU
  2. Done 42 tasks meand out of 4800, 42 fits have been completed
  3. elapsed: 2.9min - from the time execution started it took 2.9min for completing 42 fits/ 42 training

Let me know if you still have any doubts.