How to plot a ROC curve with Tensorflow and scikit-learn?
<p>I'm trying to plot the ROC curve from a modified version of the CIFAR-10 example provided by tensorflow. It's now for 2 classes instead of 10.</p>

<p>The output of the network are called logits and take the form:</p>

<blockquote>
  <p>[[-2.57313061  2.57966399]  [ 0.04221377 -0.04033273]  [-1.42880082 
  1.43337202]  [-2.7692945   2.78173304]  [-2.48195744  2.49331546]  [ 2.0941515  -2.10268974]  [-3.51670194  3.53267646]  [-2.74760485  2.75617766] ...]</p>
</blockquote>

<p>First of all, what do these logits actually represent? The final layer in the network is a "softmax linear" of form WX+b.</p>

<p>The model is able to calculate accuracy by calling</p>

<pre><code>top_k_op = tf.nn.in_top_k(logits, labels, 1)
</code></pre>

<p>Then once the graph has been initialized:</p>

<pre><code>predictions = sess.run([top_k_op])
predictions_int = np.array(predictions).astype(int)
true_count += np.sum(predictions) 
...
precision = true_count / total_sample_count
</code></pre>

<p>This works fine.</p>

<p>But now how can I plot a ROC curve from this?</p>

<p>I've been trying the "sklearn.metrics.roc_curve()" function (<a href="http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html#sklearn.metrics.roc_curve" rel="noreferrer">http://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_curve.html#sklearn.metrics.roc_curve</a>) but I don't know what to use as my "y_score" parameter.</p>

<p>Any help would be appreciated!</p>