Why we should define z as w*x+b,why not let x as the tumor size instead of z?

Hello,
Why we should define z as w*x+b,why not let z as the tumor size?
Thanks!
image
image

Hi @CHEN_Benny, We want to predict if tumor is malignant (1) or not (0) on the basis of tumor size (x). So, we already defined tumor size as x. We don’t need another variable z which is same as x. Instead we want to predict the probability of given tumor size if it belongs to malignant class. z = w*x + b is the intermediate and most important step in finding that probability.

The sigmoid has some nice properties related to probabilities, if you make some assumptions about the distribution of the values in ‘z’.

Hello Benny,

  1. First, taking z as tumor size is equivalent to having z = wx + b where x is tumer size, w=1 and b=0.
  2. Second, we are letting gradient descent to tell us whether it is the best to have w=1 and b=0 and if it is the best, then taking z as tumor size is as good, otherwise it is not. The point is, we leave to gradient descent the freedom of choosing between z as tumor size or z = wx + b
  3. It’s likely that in this example, we will not have w=1 and b=0, because tumor size is always positive, but sigmoid of a positive number is larger than 0.5 which is not always what we want. We want sigmoid of some (small) tumor size to be zero which means we want z to be less than zero. For this reason, the gradient descent should tune b to be less than 0 if w is larger than 0, so that it is possible for some z to be smaller than zero.

Cheers,
Raymond

1 Like

Thanks a lot,I got it!

Thanks a lot! I got it!

strong text

Thanks a lot! I got it!** :smiley:**

1 Like

You’re welcome Benny!

Raymond