if (A[0,i]>0.5):
Y_prediction[0,i] = 1
else:
Y_prediction[0,i] = 0
Take a look at the graph of the sigmoid function. The range of sigmoid is (0,1). The value of sigmoid(0) = 0.5. We treat the output of sigmoid as the probability that the answer (prediction) is “yes” as opposed to “no”. So if the probability is > 0.5, we interpret that as “yes”.
BTW Prof Ng explained all this in the lectures. You did watch them, right?
ahh yes yes…now i remember i was just thinking that what if we keep that value different what kind of output will we get.