evalml.model_understanding.prediction_explanations.
explain_prediction
Creates table summarizing the top_k positive and top_k negative contributing features to the prediction of a single datapoint.
XGBoost models and CatBoost multiclass classifiers are not currently supported.
pipeline (PipelineBase) – Fitted pipeline whose predictions we want to explain with SHAP.
input_features (ww.DataTable, pd.DataFrame) – Dataframe of features - needs to correspond to data the pipeline was fit on.
y (ww.DataColumn, pd.Series) – Labels for the input data.
index_to_explain (int) – The index of the row to explain in the input features.
top_k_features (int) – How many of the highest/lowest features to include in the table. Default is 3.
include_shap_values (bool) – Whether the SHAP values should be included in an extra column in the output. Default is False.
output_format (str) – Either “text”, “dict”, or “dataframe”. Default is “text”.
str, dict, or pd.DataFrame - A report explaining the most positive/negative contributing features to the predictions.
ValueError – if an output_format outside of “text”, “dict” or “dataframe is provided.