I managed to get the code right for the line of predictions = …, but I do not understand the syntax used. I didn’t use any if, and apparently it managed to classify True if A2>0.5 and False if else (for someone reading this statement, this is not the line of code).
We are using the X_new = (X > threshold)
, right? This condition checks whether each value in X_new is greater than or equal to a certain threshold. If a value is greater than or equal to a threshold, the condition evaluates to True (1); otherwise, False (0).
Best,
Saif.