tfma.EvalResult

The result of a single model analysis run.

slicing_metrics a list of tfma.SlicedMetrics, containing metric values for each slice.
plots List of slice-plot pairs.
config The config containing slicing and metrics specification.
data_location Optional location for data used with config.
file_format Optional format for data used with config.
model_location Optional location(s) for model(s) used with config.

Methods

get_metric_names

View source

Get names of metrics.

Returns
List of metric names.

get_metrics_for_all_slices

View source

Get metric names and values for every slice.

Args
output_name The name of the output (optional, only used for multi-output models).
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.

Returns
Dictionary mapping slices to metric names and values.

get_metrics_for_slice

View source

Get metric names and values for a slice.

Args
slice_name A tuple of the form (column, value), indicating which slice to get metrics from. Optional; if excluded, return overall metrics.
output_name The name of the output. Optional, only used for multi-output models.
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.

Returns
Dictionary containing metric names and values for the specified slice.

get_slice_names

View source

Get names of slices.

Returns
List of slice names.