Can your Model be Interpreted ?

Thiyaneshwaran G
2 min readDec 30, 2022

--

Here is the story that talks about a Library called Lime that helps to interpret the Model.

Hi All, I am sure you are curious as me to know more about this. Lets deep dive.

What is Lime:

Lime is abbrevated as Local Interpretable Model Agnostic Explanations. It is a technique that could be used to understand the prediction of the Model. Sounds interesting !! right..

How does this work?

Lime modifies the single data sample by making changes to the feature values and looks for the resulting impact on the output. It answers or interprets by giving us the insights on why was this prediction made based on the input we give, Lets try to explore the same in Practical implementation

The dataset is here. This is the famous Churn prediction dataset downloaded from kaggle.

To quickly explain about the dataset — its the data about customer churn rate (0 or 1) based on the X factors . Its a vanilla model — as in I have not spend more time on EDA , just have made the data to be consumed by model for its prediction.

Now we are going to use Lime for seeing the prediction and the reason for predicting a particular class

We are going to predict for the data present in the test-set . Specifically the 7th record in the Test dataset which had the above values.

Yes, here is the result : It says that 0.91 percent that it belongs to ‘0’ and the reason based on the X factors provided and we could see that except for the Gender, Geography and Balance all the other factors contribute to ‘0’. This is a very small piece of code that we have used to check how well LIME could be used to Interpret the Model.

Interestingly we could also use this to deeplearning modules, however I have not practically checked it . Maybe, I would leave it up to you to check and share your thoughts on the comments section.

That’s it for the day : I hope you enjoyed learning this module. Please leave a clap if you find it useful and share your feedbacks for me to improve the content :)

--

--

Thiyaneshwaran G

Senior Data Scientist and Intelligent Process Automation Analyst