evalml.model_understanding.prediction_explanations.
explain_predictions_best_worst
Creates a report summarizing the top contributing features for the best and worst points in the dataset as measured by error to true labels.
XGBoost models and CatBoost multiclass classifiers are not currently supported.
pipeline (PipelineBase) – Fitted pipeline whose predictions we want to explain with SHAP.
input_features (pd.DataFrame) – Dataframe of input data to evaluate the pipeline on.
y_true (pd.Series) – True labels for the input data.
num_to_explain (int) – How many of the best, worst, random data points to explain.
top_k_features (int) – How many of the highest/lowest contributing feature to include in the table for each data point.
include_shap_values (bool) – Whether SHAP values should be included in the table. Default is False.
metric (callable) – The metric used to identify the best and worst points in the dataset. Function must accept the true labels and predicted value or probabilities as the only arguments and lower values must be better. By default, this will be the absolute error for regression problems and cross entropy loss for classification problems.
output_format (str) – Either “text” or “dict”. Default is “text”.
For each of the best/worst rows of input_features, the predicted values, true labels, metric value, feature names, prediction contribution, and SHAP Value (optional) will be listed.