w_min = np.matrix(result[0])
predictions = predict(w_min, X)
correct = [
1 if ((a == 1 and b == 1) or (a == 0 and b == 0)) else 0
for (a, b) in zip(predictions, y)
]
accuracy = (sum(map(int, correct)) % len(correct))
print('accuracy = {0}%'.format(accuracy))
correct函数返回值是列表,为什么后面还要map函数转化为列表