tf.contrib.metrics.streaming_dynamic_auc
Stay organized with collections
Save and categorize content based on your preferences.
Computes the apporixmate AUC by a Riemann sum with data-derived thresholds.
tf.contrib.metrics.streaming_dynamic_auc(
labels, predictions, curve='ROC', metrics_collections=(),
updates_collections=(), name=None, weights=None
)
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
|
A Tensor of ground truth labels with the same shape as
predictions and with values of 0 or 1 whose values are castable to
int64 .
|
predictions
|
A Tensor of predictions whose values are castable to
float64 . Will be flattened into a 1-D Tensor .
|
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 that auc should
be added to.
|
updates_collections
|
An optional iterable of collections that update_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 to
float64 . Will be flattened into a 1-D Tensor .
|
Returns |
auc
|
A scalar Tensor containing the current area-under-curve value.
|
update_op
|
An operation that concatenates the input labels and predictions
to the accumulated values.
|
Raises |
ValueError
|
If labels and predictions have mismatched shapes or if
curve isn't a recognized curve type.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2020-10-01 UTC."],[],[]]