We can best explain what logistic regression does by an example problem:

Example:

Assume that we are

As can be seen, logistic regression is a binary classification problem. It is quite different from the usual linear regression.

In linear regression, we try to find a relation of the form

\begin{eqnarray}

y=\beta_0+\beta_1 x

\end{eqnarray}

between dependent and independent variables. In logistic regression, we try to find a relation like

\begin{eqnarray}

p = f(x)

\end{eqnarray}

which gives the probability of $p$ of $x$ belonging to class 1.