Hi, I have some difficulties in computing predictions. I can’t get how to classifies
to 0/1 using the given threshold. I wrote “predictions =(X > 0.5)” and when I run the tests the output is:
Predictions: [[ True False False]
[False True False]]
Error: Wrong shape
Error: Wrong output
Hi @mela, as stated in the excercise comment: # Computes probabilities using forward propagation, and classifies to 0/1 using 0.5 as the threshold.
It seems to me you have not calculated the probabilities but used the inputs directly to calculate the classification result. Hope this helps you
Hi, thanks a lot for your answer. I calculate the probabilities with
“A2, cache = forward_propagation(X, parameters)” (Sorry in the post above I missed this line). I don’t know how to classify because what I have in mind is an if-then-else statement or a for loop, but maybe is too much and there is a simpler way. I also tried an if-then-else statement in one line, but I don’t really get how to assign a value to the predictions.
Thanks again in any case
Have a nice day