# 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) + '%')

 

相关文章:

  • 2021-11-23
  • 2021-10-01
  • 2022-12-23
  • 2021-12-01
  • 2021-11-20
  • 2022-12-23
  • 2021-12-23
猜你喜欢
  • 2022-02-14
  • 2021-08-15
  • 2021-04-10
  • 2021-05-18
  • 2022-12-23
  • 2021-08-22
  • 2022-02-08
相关资源
相似解决方案