View source on GitHub |
Read and deserialize the MetricForSlice records as Pandas dataframe.
tfma.view.load_metrics_as_dataframe(
output_path: str,
output_file_format: str = 'tfrecord',
include_empty_columns: bool = False
) -> pd.DataFrame
One typical use of this dataframe table is to re-organize it in the form of slices vs. metrics table. E.g., for single model single output: result.pivot(index='slice', columns='name', values='display_value'). This only works when there is one unique value as the pivot values. Otherewise, a user needs to specify more columns or indices to make sure that the metric value is unique per column and per index. E.g., for single model and multiple outputs: result.pivot(index='slice', columns=['output_name', 'name'], values='display_value'). Args: output_path: the directory path of the metrics file. output_file_format: the file format of the metrics file, such as tfrecord. include_empty_columns: include a column if its value is not empty (None) in corresponding field in the MetricKey.
Returns | |
---|---|
A dataframe with the following columns if the value is not None:
|