View source on GitHub |
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.