# tfma.view.render_slicing_metrics

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/model-analysis/blob/v0.46.0/tensorflow_model_analysis/view/widget_view.py#L26-L57) |

Renders the slicing metrics view as widget.

    tfma.view.render_slicing_metrics(
        result: https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/EvalResult,
        slicing_column: Optional[str] = None,
        slicing_spec: Optional[Union[slicer.SingleSliceSpec, https://www.tensorflow.org/tfx/model_analysis/api_docs/python/tfma/SlicingSpec]] = None,
        weighted_example_column: Optional[str] = None,
        event_handlers: Optional[Callable[[Dict[str, Union[str, float]]], None]] = None
    ) -> Optional[visualization.SlicingMetricsViewer]

### Used in the notebooks

| Used in the tutorials |
|---|
| - [TFX Estimator Component Tutorial](https://www.tensorflow.org/tfx/tutorials/tfx/components) - [TFX Keras Component Tutorial](https://www.tensorflow.org/tfx/tutorials/tfx/components_keras) - [Create a TFX pipeline for your data with Penguin template](https://www.tensorflow.org/tfx/tutorials/tfx/penguin_template) - [Model analysis using TFX Pipeline and TensorFlow Model Analysis](https://www.tensorflow.org/tfx/tutorials/tfx/penguin_tfma) |

<br />

<br />

<br />

| ## Args ||
|---|---|
| `result` | An tfma.EvalResult. |
| `slicing_column` | The column to slice on. |
| `slicing_spec` | The tfma.SlicingSpec to filter results. If neither column nor spec is set, show overall. |
| `weighted_example_column` | Override for the weighted example column. This can be used when different weights are applied in different aprts of the model (eg: multi-head). |
| `event_handlers` | The event handlers |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A SlicingMetricsViewer object if in Jupyter notebook; None if in Colab. ||

<br />