title: How to fix Statsmodel warning: "Maximum no. of iterations has exceeded"
body: <p>I am using Anaconda and I am trying logistic regression. After loading training data set and performed the regression. Then I got the following warning message. </p>
  
  <pre><code>train_cols = data.columns[1:]
  logit = sm.Logit(data['harmful'], data[train_cols])
  result = logit.fit() 
  Warning: Maximum number of iterations has been exceeded.
       Current function value: 0.000004
       Iterations: 35
  C:\Users\dell\Anaconda\lib\site-packages\statsmodels\base\model.py:466: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals"Check mle_retvals", ConvergenceWarning)
  </code></pre>
  
  <p>Why do I get this warning and how can I fix this? 
  Thanks!</p>