![]() |
Metric wraps a set of metric computations.
tfma.metrics.Metric(
create_computations_fn: Callable[..., tfma.metrics.MetricComputations
],
**kwargs
)
This class exists to provide similarity between tfma.metrics.Metric and tf.keras.metics.Metric.
Calling computations creates the metric computations. The parameters passed to init will be combined with the parameters passed to the computations method. This allows some of the parameters (e.g. model_names, output_names, sub_keys) to be set at the time the computations are created instead of when the metric is defined.
Args | |
---|---|
create_computations_fn
|
Function to create the metrics computations (e.g. mean_label, etc). This function should take the args passed to init as as input along with any of eval_config, schema, model_names, output_names, sub_keys, aggregation_type, or query_key (where needed). |
**kwargs
|
Any additional kwargs to pass to create_computations_fn. These should only contain primitive types or lists/dicts of primitive types. The kwargs passed to computations have precendence over these kwargs. |
Attributes | |
---|---|
compute_confidence_interval
|
Whether to compute confidence intervals for this metric.
Note that this may not completely remove the computational overhead involved in computing a given metric. This is only respected by the jackknife confidence interval method. |
Methods
computations
computations(
eval_config: Optional[tfma.EvalConfig
] = None,
schema: Optional[schema_pb2.Schema] = None,
model_names: Optional[List[Text]] = None,
output_names: Optional[List[Text]] = None,
sub_keys: Optional[List[Optional[SubKey]]] = None,
aggregation_type: Optional[AggregationType] = None,
class_weights: Optional[Dict[int, float]] = None,
query_key: Optional[Text] = None,
is_diff: Optional[bool] = False
) -> tfma.metrics.MetricComputations
Creates computations associated with metric.
get_config
get_config() -> Dict[Text, Any]
Returns serializable config.