Explainability using SHAP in IBM Watson OpenScale

Pratap V
Trusted AI
Published in
5 min readDec 12, 2022

IBM Watson OpenScale brings in transparency to AI models using explainability techniques. The explanations provided for the AI model prediction can be categorised in many ways. One categorisation of the explanations is Local and Global explanation. Local explanation techniques provide the insights at a particular transaction level and the Global explanation provides the insights at the model level.

The explanations provided by OpenScale are

  • LIME(enhanced) explanations
  • Contrastive explanations
  • SHAP explanations

OpenScale provides the local explanations using LIME(enhanced), SHAP and Contrastive techniques for any AI model in a model agnostic manner. OpenScale provides global explanation for the model using SHAP and also provides global explainability stability metric to measure the degree of consistency in global explanation over time.

What is SHAP ( SHapley Additive exPlanations)?

SHAP is an explainability technique which assigns each model feature an importance value for a particular prediction, which is called a SHAP value. The Shapley value is the average marginal contribution of a feature value across all possible groups of features. The SHAP values are the estimate of the actual Shapley values. The SHAP values of the input features are the sums of the difference between average model output and the current model output for the prediction that is being explained. The average model output can be based on the summary of the training data or any subset of data that explanations must be generated for.

The SHAP values of a set of transactions can be combined to get global explanations that provide an overview of which features of a model are most important.

SHAP Global explanation in OpenScale

SHAP Global explanation in OpenScale helps in understanding the overall feature influence on the model prediction and also how the influence of the features changes over time.
Below are the various ways using which global explanation is visualised in OpenScale and are useful in understanding the model.

Global explanation stability metric timeline and Feature Influence chart

Global explanation stability metric timeline and Feature Influence chart

Global explainability stability metric measures the degree of consistency in global explanation over time and the same is shown in the above timeline. Its computed by calculating the NDCG(Normalised Discounted Cumulative Gain) score from the payload data global explanation and the baseline(training or a specified payload window) global explanation.

If the metric is trending upwards closer to 1.0, it means the metric is improving and stable and the global explanation of the payload data is similar to the baseline global explanation. If metric is trending downwards, then the metric is unstable and the global explanation of the payload data is becoming significantly different from the baseline global explanation, indicating instability. A threshold can be defined for the global explanation stability metric and when the threshold is breached its shown as issue in OpenScale dashboard and the same can be reported to the user using email alerts and can be published to OpenPages, FactSheets as well.

Feature Influence chart shows the top features having influence on the model prediction. It is shown when a particular point is selected in the global explanation stability metric timeline. It shows the features in descending order of the feature importance, which is the average of absolute SHAP values computed on the sample of payload data.

In the above screenshot, the feature LoanDuration has the highest average influence on the model prediction.

Distribution chart

Global explanation Distribution chart

Distribution chart shows the distribution of SHAP values for each prediction class. It shows the SHAP value of the feature from each datapoint in the payload data sample as a dot. The dots on the left side from the centre indicates negative SHAP value and negative influence on the prediction and the dots on the right side from the centre indicates positive SHAP value and positive influence on the prediction. The chart also shows the distribution of numeric feature values using colour code. A red dot indicate a high feature value, while a blue dot indicate a low feature value. For categorical features the dots are shown in grey colour indicating no particular order.

In the above screenshot of No Risk prediction class, for the feature Age having a higher age value(indicated by red) has negative SHAP values and having a lower age value(indicated by blue) has positive SHAP values. So for the No Risk class as the value of Age decreases the influence on the prediction is positive, indicating negative correlation of the feature with the model prediction class.

Comparison chart

Global explanation Comparison chart

Comparison chart shows the change in influence of the features between baseline global explanation and the current payload global explanation. It also shows the distributions charts of both the global explanations side by side for easy comparison.

In the above screenshot of No Risk prediction class, the feature OwnsProperty influence in the current global explanation has changed to increased compared to the baseline global explanation.

SHAP Local explanation in OpenScale

SHAP local explanation in OpenScale helps in understanding the most important features having influence on the model prediction for a specific payload datapoint.

SHAP Local explanation

The above SHAP local explanation shows the SHAP values of each feature which is the contribution made by each feature towards the model prediction for this transaction from the average model prediction.

In summary, IBM Watson OpenScale improves the transparency of AI model using SHAP Global and Local explanations in a model agnostic manner. Refer to IBM documentation for more details on how to configure explainability and view insights. To understand LIME(enhanced) and Contrastive explanations in OpenScale check here.

--

--