Logistic regression

Logistic regression is another supervised learning technique, which is basically a probabilistic classification model. It is mainly used in predicting a binary predictor, such as whether a customer is going to churn or if a credit card transaction is fraudulent.

Logistic regression uses logistics. A logistic function is a very useful function that can take any value from a negative infinity to a positive infinity, and output values from 0 to 1. Hence, it is interpretable as a probability. The following is the logistic function that generates predicted values from 0 to 1 based on the dependent x variable:

Logistic regression

Here, x will be the independent ...

Get Mastering Python for Data Science now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.