Skip to content

What-If Tool: thresholded inference problem (confusion matrix/ROC) #1463

@reinhouthooft

Description

@reinhouthooft

Version info:

  • TensorBoard 1.12.0a0
  • TensorFlow 1.8.0
  • MacOS 10.13.6
  • Python 2.7

Description:
Running 2-class classification with a custom estimator results in incorrect confusion matrix/ROC curve values. When dragging the threshold slider, the "actual yes/no" percentages change (see screenshots). Other than that, when using a vocab file to specify the labels ("False", "True"), the legend shows "False" and "undefined". The inference scores seem to return correctly.

screen shot 2018-09-26 at 3 52 06 pm

screen shot 2018-09-26 at 3 51 56 pm

screen shot 2018-09-26 at 3 56 49 pm

I would assume, even if my model would be incorrect, that the "actual" samples are unrelated to the threshold set.

Context:
The classification API is used as

signature_constants.DEFAULT_SERVING_SIGNATURE_DEF_KEY: tf.estimator.export.ClassificationOutput(scores=softmax, classes=None)

with softmax a (?,2)-shaped Tensor. This leads to the following signature:

The given SavedModel SignatureDef contains the following input(s):
  inputs['inputs'] tensor_info:
      dtype: DT_STRING
      shape: (-1)
      name: Placeholder:0
The given SavedModel SignatureDef contains the following output(s):
  outputs['scores'] tensor_info:
      dtype: DT_FLOAT
      shape: (-1, 2)
      name: softmax/Reshape_1:0
Method name is: tensorflow/serving/classify

The ground truth is specified via a numeric integer value in [0,1] (about 97% 0 and 3% 1).

screen shot 2018-09-26 at 3 51 47 pm

Inference result as shown in the datapoint editor:
screen shot 2018-09-26 at 3 57 40 pm

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions