Doubt in video concept

at 5:17 in the video we made a labels matrix and then we wrote labels[prob>0.5] = 1, but we just initialized the labels array above this step with all 0’s , the how will the value be >0.5. Should’nt we have first filled all the prob values in the labels array first and then write labels[prob>0.5]=1. Plz correct me if m wrong…

Hey @saksham_thukral, in case if we have filled the prob value in labels array, and than did labels[prob>0.5]=1, than the values which are <=0.5 will remain unchanged, they will not contain 0 instead a real number between 0 and 0.5.

So instead we first kept all labels as zeros, and finally we get the positions where prob value is greater than 0.5 by prob>0.5 and at that postition we put 1.

Also if you find your doubt is resolved, then mark it as resolved.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.