Chapter 19
Probability Meets Regression: Logistic Regression
IN THIS CHAPTER
Understanding logistic regression
Working with logistic regression
Visualizing the results
In this chapter, I explore a type of regression that’s different from any regression analysis I discuss in Chapters 14 and 16. The regression I talk about there involves a continuous dependent variable whose value you predict from a continuous independent variable (or from a set of independent variables). You make that prediction on the basis of data on each independent variable.
In this new and different type of regression, the dependent variable is the probability of a “success” of a binary event — like, say, if a person decides to buy a product (success) or not (failure) after spending some time looking at an ad for the product. “Time spent looking at the ad” is the independent variable.
The goal is to estimate the probability of buying the product based on how much time the person looks at the ad. The dependent variable is continuous, but based on what you’ve learned about probability, you know it has a minimum value of 0 and a maximum value of 1.
This is called logistic regression.
As in all regression analyses, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access