我们如何使用神经网络计算 multi-class classifier 的准确性

How do we calculate the accuracy of a multi-class classifier using neural network

当输出(预测)是来自 Softmax 函数的概率,并且训练目标是 one-hot 类型时,我们如何比较这两种不同类型的数据来计算准确率?

(正确分类的训练数据个数)/(总训练数据个数)*100%

通常,我们将soft max函数输出中概率最大的class标签作为标签。

preds 是标签的概率列表

 index=np.argmax(preds)

它将 return 它所属的标签的索引 class