
How it works...
Logistic regression is a classification method within the family of supervised learning algorithms. Using statistical methods, logistic regression allows us to generate a result that, in fact, represents a probability that a given input value belongs to a given class. In binomial logistic regression problems, the probability that output belongs to a class will be P, whereas the probability of it belonging to another class will be 1-P (where P is a number between 0 and 1 because it expresses probability).
Logistic regression uses the logistic function to determine the classification of input values. Also called the sigmoid function, the logistic function is an S-shaped curve that can take any number of of a real value and map it to a value between 0 and 1, extremes excluded. It can be described by the following equation:

This function transforms the real values into numbers between 0 and 1.