, 나는 다음과 같은 코드에 대한 하나/두 줄의 코드를 찾고 있어요 :확률을 예측 레이블로 변환하는 가장 쉽고 빠른 방법은 무엇입니까? 한마디로
for i in range(A.shape[1]):
# Convert probabilities A[0,i] to actual predictions p[0,i]
### START CODE HERE ### (≈ 4 lines of code)
if(A[i] > .5)
Y_prediction[i] = 1
else
Y_prediction[i] = 0
예상 결과와 함께 샘플 사례를 추가 하시겠습니까? – Divakar
Andrew Ng의 DL 전문 분야 코드 ...? – desertnaut