Understanding logistic regression

I am taking the coursera machine learning course by Andrew Ng and have run into some issues.

I do not understand why the answers are like this?

The equations seem to me the same but the graphs are totally different

• Please provide a logical explanation of why a decision boundary is needed, why a classifier is needed, and why predicted probabilities from logistic regression are deficient. Logistic regression is not a classifier. Jun 1, 2015 at 12:30

The pictures are a bit misleading in the sense that the outcome of the equations presented, the p-value, could also be plotted on a z-axis. Look at the picture below.

(Picture taken from http://strijov.com/sources/demoDataGen.php). Take care that the picture is illustrative only and is not related to your example perse, although the variable names match. p-value should be interpreted in this context as the probability of the dependent variable equaling a "success" or 1. (Thanks @Scortchi)

In Question 2 you can see that the coefficient of x1 is 0. This means that changing x1 does not affect the p-value. Only changing x2 affects the p-value. If the p-values values form a wave, then x1 would be the beach, to put it practically.

The decision boundary depicted is actually the line that separates the p-value that are smaller and larger than 0.5. Since this line is not affected by x1, the line is parallel to the x1 axis: changing x1 does not influence the p-values.

The illustration might resemble by chance your second example, where the coefficient of x2 is zero.

• (+1) But the probability that $Y=1$ is not called a "p-value", which has a quite specific meaning in Statistics. Jun 1, 2015 at 11:43
• Point taken. I added exta information. Jun 1, 2015 at 11:49