Member-only story
Don’t Sweat the Solver Stuff
Tips for Better Logistic Regression Models in Scikit-Learn
Logistic regression is the bread-and-butter algorithm for machine learning classification. If you’re a practicing or aspiring data scientist, you’ll want to know the ins and outs of how to use it. Also, Scikit-learn’s LogisticRegression
is spitting out warnings about changing the default solver, so this is a great time to learn when to use which solver. 😀
FutureWarning: Default solver will be changed to 'lbfgs' in 0.22. Specify a solver to silence this warning.
In this article, you’ll learn about Scikit-learn LogisticRegression
solver choices and see two evaluations of them. Also, you’ll see key API options and get answers to frequently asked questions. By the end of the article, you’ll know more about logistic regression in Scikit-learn and not sweat the solver stuff. 😓
I’m using Scikit-learn version 0.21.3 in this analysis.
UPDATE December 20, 2019: I made several edits to this article after helpful feedback from Scikit-learn core developer and maintainer, Andreas Mueller.
When to use Logistic Regression
A classification problem is one in which you try to predict discrete outcomes, such as whether someone has a disease. In…