April 2016
Beginner to intermediate
384 pages
8h 36m
English
Logistic regression is probably the second most (after linear regression) popular regression model. However, it can be easily adapted to solve a classification problem.
To run this recipe, you will need pandas and StatsModels; if you use the Anaconda distribution of Python, both of the modules are included in the distribution. We import two parts of StatsModels:
import statsmodels.api as sm import statsmodels.genmod.families.links as fm
The first one allows us to select our models and the other one to specify the link function. No other prerequisites are required.
Following a similar pattern to our previous recipe, we import all the necessary modules first, read in the data, ...
Read now
Unlock full access