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

Hello,
The logistic regression model states that f(x)=g(w.x+b)=sigmoid function.
I have trouble understanding how f(x), which is equal to z=x.w+b, can also be equal to g(z). I would appreciate it if someone could help me understand the model equation.

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

Yes, it’s clear now. thanks

Its not really clear , why z = w*x + b , where it seems like f(x) = 1 / ( 1 + e^(-x)) . Can you please go into detail here ?
Thanks

Hello @Neeraj_Badlani

Welcome to the community.

We discuss the same point here and here. please take a look.