cs231n上的一个代码,能求出准确率:

print 'accuracy: %f' % ( np.mean(Yte_predict == Yte) )

 

>>> a = np.array([1,2,3])
>>> b = np.array([2,2,3])
>>> np.mean(a==b)
0.66666666666666663

如果a[0]==b[0],返回1,不等于返回0,再把所有的加起来求平均就得到了结果

相关文章:

  • 2021-10-10
  • 2022-12-23
  • 2022-12-23
  • 2021-07-29
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-07
  • 2022-01-21
  • 2021-06-11
相关资源
相似解决方案