tfma.EvalResult
Stay organized with collections
Save and categorize content based on your preferences.
The result of a single model analysis run.
tfma.EvalResult(
slicing_metrics,
plots,
attributions,
config,
data_location,
file_format,
model_location
)
Attributes |
slicing_metrics
|
a list of tfma.SlicedMetrics , containing metric values
for each slice.
|
plots
|
List of slice-plot pairs.
|
attributions
|
List of SlicedAttributions containing attribution values for
each slice.
|
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_attributions_for_all_slices
View source
get_attributions_for_all_slices(
metric_name: str = '',
output_name: str = '',
class_id: Optional[int] = None,
k: Optional[int] = None,
top_k: Optional[int] = None
) -> Dict[str, AttributionsByFeatureKey]
Get attribution feature keys and values for every slice.
Args |
metric_name
|
Name of metric to get attributions for. Optional if only one
metric used.
|
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 attribution feature keys and values.
|
get_attributions_for_slice
View source
get_attributions_for_slice(
slice_name: slicer.SliceKeyType = (),
metric_name: str = '',
output_name: str = '',
class_id: Optional[int] = None,
k: Optional[int] = None,
top_k: Optional[int] = None
) -> Union[AttributionsByFeatureKey, None]
Get attribution features names and values for a slice.
Args |
slice_name
|
A tuple of the form (column, value), indicating which slice to
get attributions from. Optional; if excluded, use overall slice.
|
metric_name
|
Name of metric to get attributions for. Optional if only one
metric used.
|
output_name
|
The name of the output. Optional, only used for multi-output
models.
|
class_id
|
Used with multi-class models to identify a specific class ID.
|
k
|
Used with multi-class models to identify the kth predicted value.
|
top_k
|
Used with multi-class models to identify top-k attribution values.
|
Returns |
Dictionary containing feature keys and values for the specified slice.
|
Raises |
ValueError
|
If metric_name is required.
|
get_metric_names
View source
get_metric_names() -> Sequence[str]
Get names of metrics.
Returns |
List of metric names.
|
get_metrics_for_all_slices
View source
get_metrics_for_all_slices(
output_name: str = '',
class_id: Optional[int] = None,
k: Optional[int] = None,
top_k: Optional[int] = None
) -> Dict[str, MetricsByTextKey]
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_metrics_for_slice(
slice_name: slicer.SliceKeyType = (),
output_name: str = '',
class_id: Optional[int] = None,
k: Optional[int] = None,
top_k: Optional[int] = None
) -> Union[MetricsByTextKey, None]
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_slice_names() -> Sequence[str]
Get names of slices.
Returns |
List of slice names.
|
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.EvalResult\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/view_types.py#L151-L367) |\n\nThe result of a single model analysis run. \n\n tfma.EvalResult(\n slicing_metrics,\n plots,\n attributions,\n config,\n data_location,\n file_format,\n model_location\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|-------------------|--------------------------------------------------------------------------|\n| `slicing_metrics` | a list of `tfma.SlicedMetrics`, containing metric values for each slice. |\n| `plots` | List of slice-plot pairs. |\n| `attributions` | List of SlicedAttributions containing attribution values for each slice. |\n| `config` | The config containing slicing and metrics specification. |\n| `data_location` | Optional location for data used with config. |\n| `file_format` | Optional format for data used with config. |\n| `model_location` | Optional location(s) for model(s) used with config. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `get_attributions_for_all_slices`\n\n[View source](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/view_types.py#L318-L358) \n\n get_attributions_for_all_slices(\n metric_name: str = '',\n output_name: str = '',\n class_id: Optional[int] = None,\n k: Optional[int] = None,\n top_k: Optional[int] = None\n ) -\u003e Dict[str, AttributionsByFeatureKey]\n\nGet attribution feature keys and values for every slice.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------------|-------------------------------------------------------------------------------|\n| `metric_name` | Name of metric to get attributions for. Optional if only one metric used. |\n| `output_name` | The name of the output (optional, only used for multi-output models). |\n| `class_id` | Used with multi-class metrics to identify a specific class ID. |\n| `k` | Used with multi-class metrics to identify the kth predicted value. |\n| `top_k` | Used with multi-class and ranking metrics to identify top-k predicted values. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| Dictionary mapping slices to attribution feature keys and values. ||\n\n\u003cbr /\u003e\n\n### `get_attributions_for_slice`\n\n[View source](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/view_types.py#L263-L316) \n\n get_attributions_for_slice(\n slice_name: slicer.SliceKeyType = (),\n metric_name: str = '',\n output_name: str = '',\n class_id: Optional[int] = None,\n k: Optional[int] = None,\n top_k: Optional[int] = None\n ) -\u003e Union[AttributionsByFeatureKey, None]\n\nGet attribution features names and values for a slice.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `slice_name` | A tuple of the form (column, value), indicating which slice to get attributions from. Optional; if excluded, use overall slice. |\n| `metric_name` | Name of metric to get attributions for. Optional if only one metric used. |\n| `output_name` | The name of the output. Optional, only used for multi-output models. |\n| `class_id` | Used with multi-class models to identify a specific class ID. |\n| `k` | Used with multi-class models to identify the kth predicted value. |\n| `top_k` | Used with multi-class models to identify top-k attribution values. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| Dictionary containing feature keys and values for the specified slice. ||\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ||\n|--------------|-----------------------------|\n| `ValueError` | If metric_name is required. |\n\n\u003cbr /\u003e\n\n### `get_metric_names`\n\n[View source](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/view_types.py#L249-L261) \n\n get_metric_names() -\u003e Sequence[str]\n\nGet names of metrics.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| List of metric names. ||\n\n\u003cbr /\u003e\n\n### `get_metrics_for_all_slices`\n\n[View source](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/view_types.py#L214-L247) \n\n get_metrics_for_all_slices(\n output_name: str = '',\n class_id: Optional[int] = None,\n k: Optional[int] = None,\n top_k: Optional[int] = None\n ) -\u003e Dict[str, MetricsByTextKey]\n\nGet metric names and values for every slice.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------------|-------------------------------------------------------------------------------|\n| `output_name` | The name of the output (optional, only used for multi-output models). |\n| `class_id` | Used with multi-class metrics to identify a specific class ID. |\n| `k` | Used with multi-class metrics to identify the kth predicted value. |\n| `top_k` | Used with multi-class and ranking metrics to identify top-k predicted values. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| Dictionary mapping slices to metric names and values. ||\n\n\u003cbr /\u003e\n\n### `get_metrics_for_slice`\n\n[View source](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/view_types.py#L172-L212) \n\n get_metrics_for_slice(\n slice_name: slicer.SliceKeyType = (),\n output_name: str = '',\n class_id: Optional[int] = None,\n k: Optional[int] = None,\n top_k: Optional[int] = None\n ) -\u003e Union[MetricsByTextKey, None]\n\nGet metric names and values for a slice.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|---------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `slice_name` | A tuple of the form (column, value), indicating which slice to get metrics from. Optional; if excluded, return overall metrics. |\n| `output_name` | The name of the output. Optional, only used for multi-output models. |\n| `class_id` | Used with multi-class metrics to identify a specific class ID. |\n| `k` | Used with multi-class metrics to identify the kth predicted value. |\n| `top_k` | Used with multi-class and ranking metrics to identify top-k predicted values. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| Dictionary containing metric names and values for the specified slice. ||\n\n\u003cbr /\u003e\n\n### `get_slice_names`\n\n[View source](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/view_types.py#L360-L367) \n\n get_slice_names() -\u003e Sequence[str]\n\nGet names of slices.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| List of slice names. ||\n\n\u003cbr /\u003e"]]