tf.estimator.export.ClassificationOutput
tf.estimator.export.ClassificationOutput
class tf.estimator.export.ClassificationOutput
Defined in tensorflow/python/estimator/export/export_output.py
.
Represents the output of a classification head.
Either classes or scores or both must be set.
The classes Tensor
must provide string labels, not integer class IDs.
If only classes is set, it is interpreted as providing top-k results in descending order.
If only scores is set, it is interpreted as providing a score for every class in order of class ID.
If both classes and scores are set, they are interpreted as zipped, so each score corresponds to the class at the same index. Clients should not depend on the order of the entries.
Properties
classes
scores
Methods
__init__
__init__( scores=None, classes=None )
Constructor for ClassifyOutput
.
Args:
-
scores
: A floatTensor
giving scores (sometimes but not always interpretable as probabilities) for each class. May beNone
, but only ifclasses
is set. Interpretation varies-- see class doc. -
classes
: A stringTensor
giving predicted class labels. May beNone
, but only ifscores
is set. Interpretation varies-- see class doc.
Raises:
-
ValueError
: if neither classes nor scores is set, or one of them is not aTensor
with the correct dtype.
as_signature_def
as_signature_def(receiver_tensors)
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/estimator/export/ClassificationOutput