Error while running the grid search code

I am running the grid search code as it is from Github. getting following error

C:\Users\hp\PycharmProjects\pythonCW\venv\lib\site-packages\sklearn\linear_model_logistic.py:762: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.

Increase the number of iterations (max_iter) or scale the data as shown in:
https://scikit-learn.org/stable/modules/preprocessing.html
Please also refer to the documentation for alternative solver options:
https://scikit-learn.org/stable/modules/linear_model.html#logistic-regression
n_iter_i = _check_optimize_result(
C:\Users\hp\PycharmProjects\pythonCW\venv\lib\site-packages\sklearn\linear_model_logistic.py:762: ConvergenceWarning: lbfgs failed to converge (status=1):
STOP: TOTAL NO. of ITERATIONS REACHED LIMIT.

Kindly suggest what changes to be made

hey @sanandasaha3 ,
it is not an error as such , it is just a warning stating that the logistic regression model that you are using more number of iteration to fit the data well. Currently it fitting , but will be providing really bad results . Or you can do is you can scale your data , it might help in convergence but it is also not sure that it will lead to convergence.

There is parameter max_iter in logistic regression , which by default 1000. You can change to here value like 10000 or 100000 , any but just greater than 1000 and see how your model performs respectively on that.

I hope this would help you.
Thank You and Happy Learning :slightly_smiling_face:.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.