snowflake.ml.monitoring.explain_visualize.plot_influence_sensitivity¶
- snowflake.ml.monitoring.explain_visualize.plot_influence_sensitivity(shap_values: 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_values: 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, infer_is_categorical: bool = True, figsize: tuple[float, float] = (1400, 500)) Any¶
Create a SHAP dependence scatter plot for a specific feature. If a DataFrame is provided, a select box will be displayed to select the feature. This is only supported in Snowflake notebooks. If Streamlit is not available and a DataFrame is passed in, an ImportError will be raised.
- Parameters:
shap_values – pandas Series or 2D array containing the SHAP values for a specific feature
feature_values – pandas Series or 2D array containing the feature values for the same feature
infer_is_categorical – If True, the function will infer if the feature is categorical based on the number of unique values.
figsize – tuple of (width, height) for the plot
- Returns:
Altair chart object
- Raises:
ValueError – If the types of feature_values and shap_values are not the same