擅长:python、mysql、java
<p>根据文档,y_真值和y_分数应为1-d</p>
<p><a href="https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html" rel="nofollow noreferrer">https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html</a></p>
<p><strong>y\u truearray,shape=[n\u示例]</strong></p>
<p>因此,只需获取标签,而不是softmax输出</p>
<p>在roc_曲线()之前添加以下行</p>
<pre><code>test_y = np.argmax(test_y, axis=-1) # getting the labels
y_prediction = np.argmax(y_prediction, axis=-1) # getting the confidence of postive class
</code></pre>