Making sense of f(x) meaning both g(z) and wx+b

image
Considering this image.

I was confused because in weeks 1 and 2, we were told that
fw,b(x) was actually wx + b (where w and x are either scalars or vectors, depending on whether this is univariate linear regression or multi linear regression).

But now this week, I’m now told here that fw,b(x) is g(z).

I think this is my limited past experience in advanced math coming up here. And all I need is a bit of background. I was confused because how is fw,b(x) both?

Now it’s dawning on me that maybe fw,b(x) is just an abstraction and what the course is saying is:

  • In the case of linear regression, fw,b(x) = wx+b
  • In the case of logistic regression, fw,b(x) = g(z) which happens to also use wx+b, in this case in the form of z.

Do I have that right?

Thank you for your patience explaining what seems to be such a basic core concept. :slight_smile:

In the earlier courses, you were doing linear regression.

In this week, it’s logistic regression.

The main difference is that for logistic regression, you have to pass the calculation through the sigmoid() function.

Hello,

your confusion was for fw,b(x) for linear wx +b and for logistic g(z) and how it can be for both?

then your understanding that both stands for the same but wx+b is called by z in logistic, this understanding is correct.

Just understand in the video, Prof. Ng used for linear fw,b(x) = wx+b

where as in logistic he denoted wx+b as z where fw, b(x) is sigmoid of wx+b which is g(z).

So your understanding is perfectly correct.

Regards
DP

1 Like

@Deepti_Prasad , I already said that, but more simply.

Yes you did explain but I wanted to explain to him in his terms of understanding statement, as he had a correct understanding but was confused, so I explained using his mentioned statements.

I hope this is not a problem. if yes, then extremely sorry.

Regards
DP

Thanks @Deepti_Prasad. This is what I was looking for.

I understood independently the two different calculations for for linear and logistic regressions, that is, the difference between the linear and sigmoid functions. I also understood that I was doing linear regression in weeks 1 and 2 and logistic regression in week 3.

I didn’t need those explained to me. But perhaps I didn’t make that clear enough.

My confusion was specifically how f(x) somehow meant both. But it doesn’t mean both…rather it means either, or rather (as I understand it) it’s an abstract notation which needs to be defined for each.

Which you confirmed for me here. Thanks!