tfma.view.SlicedMetrics
Stay organized with collections
Save and categorize content based on your preferences.
A tuple containing the metrics belonging to a slice.
tfma.view.SlicedMetrics(
slice, metrics
)
The metrics are stored in a nested dictionary with the following levels:
- output_name: Optional output name associated with metric (for multi-output
models). '' by default.
- sub_key: Optional sub key associated with metric (for multi-class models).
'' by default. See
tfma.metrics.SubKey
for more info.
- metric_name: Name of the metric (
auc
, accuracy
, etc).
- metric_value: A dictionary containing the metric's value. See
tfma.proto.metrics_for_slice_pb2.MetricValue
for more info.
Below is a sample SlicedMetrics:
(
(('color', 'green')),
{
'': { # default for single-output models
'': { # default sub_key for non-multiclass-classification models
'auc': {
'doubleValue': 0.7243943810462952
},
'accuracy': {
'doubleValue': 0.6488351225852966
}
}
}
}
)
Attributes |
slice
|
A 2-element tuple representing a slice. The first element is the key
of a feature (ex: 'color'), and the second element is the value (ex:
'green'). An empty tuple represents an 'overall' slice (i.e. one that
encompasses the entire dataset.
|
metrics
|
A nested dictionary containing metric names and values.
|
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 2024-04-26 UTC.
[null,null,["Last updated 2024-04-26 UTC."],[],[],null,["# tfma.view.SlicedMetrics\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/view_types.py#L51-L93) |\n\nA tuple containing the metrics belonging to a slice. \n\n tfma.view.SlicedMetrics(\n slice, metrics\n )\n\nThe metrics are stored in a nested dictionary with the following levels:\n\n1. output_name: Optional output name associated with metric (for multi-output models). '' by default.\n2. sub_key: Optional sub key associated with metric (for multi-class models). '' by default. See [`tfma.metrics.SubKey`](../../tfma/metrics/SubKey) for more info.\n3. metric_name: Name of the metric (`auc`, `accuracy`, etc).\n4. metric_value: A dictionary containing the metric's value. See [`tfma.proto.metrics_for_slice_pb2.MetricValue`](https://github.com/tensorflow/model-analysis/blob/cdb6790dcd7a37c82afb493859b3ef4898963fee/tensorflow_model_analysis/proto/metrics_for_slice.proto#L194) for more info.\n\nBelow is a sample SlicedMetrics: \n\n (\n (('color', 'green')),\n {\n '': { # default for single-output models\n '': { # default sub_key for non-multiclass-classification models\n 'auc': {\n 'doubleValue': 0.7243943810462952\n },\n 'accuracy': {\n 'doubleValue': 0.6488351225852966\n }\n }\n }\n }\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `slice` | A 2-element tuple representing a slice. The first element is the key of a feature (ex: 'color'), and the second element is the value (ex: 'green'). An empty tuple represents an 'overall' slice (i.e. one that encompasses the entire dataset. |\n| `metrics` | A nested dictionary containing metric names and values. |\n\n\u003cbr /\u003e"]]