Optional Lab: Logistic Regression

In the optional lab, I noticed
โ€œNote, the orange line is โ€˜๐‘งโ€™ or ๐ฐโ‹…๐ฑ(๐‘–)+๐‘ above. It does not match the line in a linear regression model.โ€

Itโ€™s unclear to me why wx + b would be different than what we get in the linear regression model. Isnโ€™t z nothing but the linear regression model?

In logistic regression, you also use the sigmoid() function.

Sigmoid is used on top of the z function, right? So, g(z) is the sigmoid, but z itself should be an affine function and therefore same as what you get via linear regression.

sigmoid() does transform โ€˜zโ€™, but I donโ€™t think โ€œaffineโ€ is the best description.

For one issue, when you need the gradients of the logistic function, you have to deal with the partial derivative of the sigmoid function. Thatโ€™s a bit more complicated than just the partial derivative of z = w*x + b (whose derivative is just โ€˜wโ€™).