Week 2: Explanation of Logistic Regression Cost Function

I have a question regarding Professor Ng’s video, “Explanation of Logistic Regression Cost Function (Optional)” in week 2.
If y = 1, P(y|x) = y hat
If y = 0, P(y|x) = 1 - y hat
What does the P(y|x) mean? In video mentioned chance of y given x, but what exactly this means?
Is it
P(y=1|x) = y hat
P(y=0|x) = 1 - y hat

Hi, @Jossent. P(y|x) is notation for "the probability of y conditional on the value of x. In this week’s application x would represent an particular image. If that image contained two pointed ears and whiskers (for example), the conditional probability \hat{y} would be higher than if the image was one of a car. If you want to do a deeper dive, Google “conditional probability”.

1 Like