tfma.metrics.SubKey
Stay organized with collections
Save and categorize content based on your preferences.
A SubKey identifies a sub-types of metrics and plots.
tfma.metrics.SubKey(
class_id: Optional[int] = None,
k: Optional[int] = None,
top_k: Optional[int] = None
)
Only one of class_id, k, or top_k can be set at a time.
Attributes |
class_id
|
Used with multi-class metrics to identify a specific class ID.
|
k
|
Used with multi-class metrics to identify the kth predicted value.
|
top_k
|
Used with multi-class and ranking metrics to identify top-k predicted
values.
|
Methods
from_proto
View source
@staticmethod
from_proto(
pb: metrics_for_slice_pb2.SubKey
) -> Optional['SubKey']
Creates class from proto.
to_proto
View source
to_proto() -> metrics_for_slice_pb2.SubKey
Converts key to proto.
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.metrics.SubKey\n\n\u003cbr /\u003e\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/metrics/metric_types.py#L36-L133) |\n\nA SubKey identifies a sub-types of metrics and plots. \n\n tfma.metrics.SubKey(\n class_id: Optional[int] = None,\n k: Optional[int] = None,\n top_k: Optional[int] = None\n )\n\nOnly one of class_id, k, or top_k can be set at a time.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|------------|-------------------------------------------------------------------------------|\n| `class_id` | Used with multi-class metrics to identify a specific class ID. |\n| `k` | Used with multi-class metrics to identify the kth predicted value. |\n| `top_k` | Used with multi-class and ranking metrics to identify top-k predicted values. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `from_proto`\n\n[View source](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/metrics/metric_types.py#L118-L133) \n\n @staticmethod\n from_proto(\n pb: metrics_for_slice_pb2.SubKey\n ) -\u003e Optional['SubKey']\n\nCreates class from proto.\n\n### `to_proto`\n\n[View source](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/metrics/metric_types.py#L107-L116) \n\n to_proto() -\u003e metrics_for_slice_pb2.SubKey\n\nConverts key to proto."]]