【发布时间】:2018-05-22 06:57:45
【问题描述】:
简而言之,我正在寻找以下代码的一/两行代码:
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
【问题讨论】:
-
添加具有预期输出的示例案例?
-
Andrew Ng 的 DL 专业的代码...?
标签: numpy machine-learning classification vectorization logistic-regression