# Print accuracy
predictions = predict(parameters, X)
# (np.dot(Y, predictions.T) + np.dot(1 - Y, 1 - predictions.T)) / Y.size
print ("Accuracy: {} %".format(100 - np.mean(abs(predictions - Y)) * 100)) # 或者
print ('Accuracy: %d' % float((np.dot(Y, predictions.T) + np.dot(1-Y,1-predictions.T))/float(Y.size)*100) + '%')