tf.contrib.metrics.streaming_dynamic_auc(
labels,
predictions,
curve='ROC',
metrics_collections=(),
updates_collections=(),
name=None,
weights=None
)
Defined in tensorflow/contrib/metrics/python/ops/metric_ops.py
.
Computes the apporixmate AUC by a Riemann sum with data-derived thresholds.
USAGE NOTE: this approach requires storing all of the predictions and labels for a single evaluation in memory, so it may not be usable when the evaluation batch size and/or the number of evaluation steps is very large.
Computes the area under the ROC or PR curve using each prediction as a threshold. This has the advantage of being resilient to the distribution of predictions by aggregating across batches, accumulating labels and predictions and performing the final calculation using all of the concatenated values.
Args:
labels
: ATensor
of ground truth labels with the same shape aslabels
and with values of 0 or 1 whose values are castable toint64
.predictions
: ATensor
of predictions whose values are castable tofloat64
. Will be flattened into a 1-DTensor
.curve
: The name of the curve for which to compute AUC, 'ROC' for the Receiving Operating Characteristic or 'PR' for the Precision-Recall curve.metrics_collections
: An optional iterable of collections thatauc
should be added to.updates_collections
: An optional iterable of collections thatupdate_op
should be added to.name
: An optional name for the variable_scope that contains the metric variables.weights
: A 'Tensor' of non-negative weights whose values are castable tofloat64
. Will be flattened into a 1-DTensor
.
Returns:
auc
: A scalarTensor
containing the current area-under-curve value.update_op
: An operation that concatenates the input labels and predictions to the accumulated values.
Raises:
ValueError
: Iflabels
andpredictions
have mismatched shapes or ifcurve
isn't a recognized curve type.