BookmarkSubscribeRSS Feed
Ullsokk
Pyrite | Level 9

How do I get a LIME explanation for a specific observation is sas viya 3.5? I want to be able to explain why a specific customer has a high probability value on a model.  

3 REPLIES 3
sbxkoenk
SAS Super FREQ

@Ullsokk wrote:

How do I get a LIME explanation for a specific observation is sas viya 3.5? I want to be able to explain why a specific customer has a high probability value on a model.  


I moved this topic to "Data Science board".

A LIME explanation for one specific observation ??
To explain your high probability value you need to estimate Shapley values!

Run the shapleyExplainer action in PROC CAS (HyperSHAP and KernelSHAP methods are available).

In this blog they explain how to do : Parallel Shapley value estimation
https://blogs.sas.com/content/subconsciousmusings/2021/07/06/tips-for-parallel-processing-in-casl/

(it might be worthwhile to do it in parallel because it takes a lot of resources

, so if you do not have a lot of resources --> then it takes time)

Good luck,
koen

sbxkoenk
SAS Super FREQ

On top of previous response ...

 

Subject: interpreting complex (machine learning) models

  • partial dependency plots
  • variable importance plots / Variable Importance Rankings
  • LIME (Local Interpretable Model Agnostic Explanations)
  • ICE (Individual Conditional Expectation)
  • SHAPLEY values

Some resources (#5):

Enjoy!

Koen

xinhunt
SAS Employee

As Koen has explained in an earlier reply, Shapley values may be more appropriate for your use case because Shapley values give you the importance of each input variable for a prediction. LIME values tells you "how much would I expect the prediction to change if I change one/some of the inputs near this observation" which is not exactly the same as feature importance, but could be useful for different scenarios.

 

To calculate Shapley values or LIME values, you can use the explainModel action set. Here are some links for code examples -- all links are for Viya3.5:

(1) Example for calculating Shapley values using ShapleyExplainer (HyperSHAP, preferred method for Shapley value estimation) 

(2) Example for calculating LIME values

(3) Example for calculating Shapley values using linearExplainer (KernelSHAP, can be less accurate than HyperSHAP, but in case you need an alternative method):

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1381 views
  • 2 likes
  • 3 in conversation