tfma.metrics.DerivedMetricComputation
Stay organized with collections
Save and categorize content based on your preferences.
DerivedMetricComputation derives its result from other computations.
tfma.metrics.DerivedMetricComputation(
keys: List[tfma.metrics.MetricKey
],
result: Callable[[Dict[MetricKey, Any]], Dict[MetricKey, Any]]
)
When creating derived metric computations it is recommended (but not required)
that the underlying MetricComputations that they depend on are defined at the
same time. This is to avoid having to pre-construct and pass around all the
required dependencies in order to construct a derived metric. The evaluation
pipeline is responsible for de-duplicating overlapping MetricComputations so
that only one computation is actually run.
A DerivedMetricComputation is uniquely identified by the combination of the
result function's name and the keys. Duplicate computations will be removed
automatically.
Attributes |
keys
|
List of metric keys associated with derived computation. If the keys
are defined as part of the computation then this may be empty in which
case only the result function name will be used for identifying
computation uniqueness.
|
result
|
Function (called per slice) to compute the result using the results
of other metric computations.
|
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.DerivedMetricComputation\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#L570-L622) |\n\nDerivedMetricComputation derives its result from other computations. \n\n tfma.metrics.DerivedMetricComputation(\n keys: List[../../tfma/metrics/MetricKey],\n result: Callable[[Dict[MetricKey, Any]], Dict[MetricKey, Any]]\n )\n\nWhen creating derived metric computations it is recommended (but not required)\nthat the underlying MetricComputations that they depend on are defined at the\nsame time. This is to avoid having to pre-construct and pass around all the\nrequired dependencies in order to construct a derived metric. The evaluation\npipeline is responsible for de-duplicating overlapping MetricComputations so\nthat only one computation is actually run.\n\nA DerivedMetricComputation is uniquely identified by the combination of the\nresult function's name and the keys. Duplicate computations will be removed\nautomatically.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `keys` | List of metric keys associated with derived computation. If the keys are defined as part of the computation then this may be empty in which case only the result function name will be used for identifying computation uniqueness. |\n| `result` | Function (called per slice) to compute the result using the results of other metric computations. |\n\n\u003cbr /\u003e"]]