Logistic regression: why f(x)=g(z)?

Hello @Yara

Welcome to the community.

There are 2 different models that we are discussing here:

  1. Linear Regression
  2. Logistic Regression

For the Linear Regression f(x) = w.x +b,
And
For Logistic Regression f(x) = g(z) , where z = w.x+b and hence f(x) = g(w.x+b).

We dont really need the intermediate “z”, and can directly write it as f(x) = g(w.x+b) where g stands for the sigmoid function. Furthermore, we can directly write f(x) = sigmoid(w.x+b). Just to make things look less cluttered and to make the equations more readable, we have brought in the covenience of “g” and “z”. Also, later on when we get into calculus and partial derivatives, having these conveniences will help to bring in some order while doing the Chain Rule - We could do without it as well, but no harm in making things a little easier for us.

We use the generic representation of a function “f(x)” to refer to the model in both the Linear Regression and Logistic Regression cases. However, let us keep in mind that they refer to 2 different models and hence they are actually 2 different functions, but referred to generically as f(x).

Hope this clarifies.

1 Like