snowflake.ml.monitoring.explain_visualize.plot_violin

snowflake.ml.monitoring.explain_visualize.plot_violin(shap_df: pd.DataFrame | ndarray[tuple[Any, ...], dtype[np.int8 | np.int16 | np.int32 | np.int64 | np.float32 | np.float64 | np.uint8 | np.uint16 | np.uint32 | np.uint64 | np.bool_ | np.str_ | np.bytes_ | np.datetime64]] | torch.Tensor | tensorflow.Tensor | tensorflow.Variable | Sequence[ndarray[tuple[Any, ...], dtype[np.int8 | np.int16 | np.int32 | np.int64 | np.float32 | np.float64 | np.uint8 | np.uint16 | np.uint32 | np.uint64 | np.bool_ | np.str_ | np.bytes_ | np.datetime64]] | torch.Tensor | tensorflow.Tensor | tensorflow.Variable] | Sequence[int | float | bool | str | bytes | dict[str, _SupportedBuiltins | _SupportedBuiltinsList] | _SupportedBuiltinsList] | snowflake.snowpark.DataFrame, feature_df: pd.DataFrame | ndarray[tuple[Any, ...], dtype[np.int8 | np.int16 | np.int32 | np.int64 | np.float32 | np.float64 | np.uint8 | np.uint16 | np.uint32 | np.uint64 | np.bool_ | np.str_ | np.bytes_ | np.datetime64]] | torch.Tensor | tensorflow.Tensor | tensorflow.Variable | Sequence[ndarray[tuple[Any, ...], dtype[np.int8 | np.int16 | np.int32 | np.int64 | np.float32 | np.float64 | np.uint8 | np.uint16 | np.uint32 | np.uint64 | np.bool_ | np.str_ | np.bytes_ | np.datetime64]] | torch.Tensor | tensorflow.Tensor | tensorflow.Variable] | Sequence[int | float | bool | str | bytes | dict[str, _SupportedBuiltins | _SupportedBuiltinsList] | _SupportedBuiltinsList] | snowflake.snowpark.DataFrame, figsize: tuple[float, float] = (1400, 100)) Chart

Create a violin plot per feature showing the distribution of SHAP values.

Parameters:
  • shap_df – 2D array containing SHAP values for multiple features

  • feature_df – 2D array containing the corresponding feature values

  • figsize – tuple of (width, height) for the plot

Returns:

Altair chart object