Logistic regression, even though it is called regression, is actually a (binary) classification method. The model is essentially just a composition of a linear model and the logistic function, which is an s-shaped curve and which is shown in the following figure.

The logistic function.

Thus, the output of the model will be a value between 0 and 1. If the output is greater than or equal to a certain threshold – e.g. 0.5, we classify the input into class “1”. If it is less than the threshold, we classify it as class “0”.

Given that this model is not purely linear, unlike in linear regression, the optimal parameters cannot be computed quite as easily: one needs to use some kind of iterative optimization, like a gradient-based (but typically higher-order) optimization method.