kernelshap_tabular ================== .. py:module:: kernelshap_tabular Classes ------- .. autoapisummary:: kernelshap_tabular.KERNELSHAPTabular Module Contents --------------- .. py:class:: KERNELSHAPTabular(training_data: numpy.array, mode: str = 'classification', feature_names: List[int] = None, training_data_kmeans: Optional[int] = None, silent: bool = False) Wrapper around the SHAP Kernel explainer for tabular data. .. py:attribute:: feature_names .. py:attribute:: mode .. py:attribute:: explainer :type: shap.KernelExplainer .. py:attribute:: silent .. py:method:: explain(model_or_function: Union[str, callable], input_tabular: numpy.array, link: str = 'identity', **kwargs) -> numpy.array Run the KernelSHAP explainer. :param model_or_function: The function that runs the model to be explained or the path to a ONNX model on disk. :type model_or_function: callable or str :param input_tabular: Data to be explained. :type input_tabular: np.ndarray :param link: A generalized linear model link to connect the feature importance values to the model. Must be either "identity" or "logit". :type link: str :param kwargs: These parameters are passed on Other keyword arguments: see the documentation for KernelExplainer: https://github.com/shap/shap/blob/master/shap/explainers/_kernel.py :returns: An array (np.ndarray) containing the KernelExplainer explanations for each class.