Logistic Regression on MNIST Dataset

Why doesn’t [ lr = LogisticRegression() ] is showing the iteration error?
I have tried doing it by setting the max_itr less than the default value but still getting the same error.
This same piece of code works well when I am providing n_jobs = -1. Does there is any relation between iteration and CPU count?

hey @aakritiaggarwal ,
Logistic regression works for a particular number of iteration , say 100 , and there is an in built functioning of a solver that tells whether the results converged or not.
So , when you were using it without n_jobs , in these number of iterations it told with a warning to you that it might had not converged to get the actual results.
But when you used it with n_jobs it used all the CPU cores and ran these iteration on all of them and hence was able to converge properly.
This is the reason that you didn’t get any error on that.

Yeah You can say so. But actually it isn’t . Its a relation between your data and CPU counts . If your data is quite large then you should go for n_jobs to get better results from it.

I hope this helped you understand this.
Thank You :slightly_smiling_face:.

1 Like

Hey @prashant_ml
I totally understood it.
Thank you.