Hands-on Machine Learning Model Interpretation

the middle-aged people have a slightly higher shap value, pushing the model’s prediction decisions to say that these individuals make more money as compared to younger or older peoplePDP of ‘Education-Num’ affecting model predictionLet’s take a look at how the Education-Num feature affects model predictions.PDP for the Education-Num featureHigher education levels have higher shap values, pushing the model’s prediction decisions to say that these individuals make more money as compared to people with lower education levels.PDP of ‘Relationship’ affecting model predictionLet’s take a look at how the Relationship feature affects model predictions.PDP for the Relationship featureJust like we observed during the model prediction explanations, married people (husband or wife) have a slightly higher shap value, pushing the model’s prediction decisions to say that these individuals make more money as compared to other folks!PDP of ‘Capital Gain’ affecting model predictionLet’s take a look at how the Capital Gain feature affects model predictions.PDP for the Capital Gain featureTwo-way PDP showing interactions between features ‘Age’ and ‘Capital Gain’ and their effect on making more than $50KThe vertical dispersion of SHAP values at a single feature value is driven by interaction effects, and another feature is chosen for coloring to highlight possible interactions..Here we are trying to see interactions between Age and Capital Gainand also their effect on the SHAP values which lead to the model predicting if the person will make more money or not, with the help of a two-way partial dependence plot.Two-way PDP showing effects of the Age and Capital Gain featuresInteresting to see higher the higher capital gain and the middle-aged folks (30–50) having the highest chance of making more money!Two-way PDP showing interactions between features ‘Education-Num’ and ‘Relationship’ and their effect on making more than $50KHere we are trying to see interactions between Education-Num and Relationship and also their effect on the SHAP values which lead to the model predicting if the person will make more money or not, with the help of a two-way partial dependence plot.Two-way PDP showing effects of the Education-Num and Relationship featuresThis is interesting because both the features are similar in some context, we can see typically married people with relationship status of either husband or wife having the highest chance of making more money!Two-way PDP showing interactions between features ‘Marital Status’ and ‘Relationship’ and their effect on making more than $50KHere we are trying to see interactions between Marital Status and Relationship and also their effect on the SHAP values which lead to the model predicting if the person will make more money or not, with the help of a two-way partial dependence plot.Two-way PDP showing effects of the Marital Status and Relationship featuresInteresting to see higher the higher education level and the husband or wife (married) folks having the highest chance of making more money!Two-way PDP showing interactions between features ‘Age’ and ‘Hours per week’ and their effect on making more than $50KHere we are trying to see interactions between Age and Hours per week and also their effect on the SHAP values which lead to the model predicting if the person will make more money or not, with the help of a two-way partial dependence plot.Two-way PDP showing effects of the Age and Hours per week featuresNothing extra-ordinary here, middle-aged people working the most make the most money!ConclusionIf you are reading this, I would like to really commend your efforts on going through this huge and comprehensive tutorial on machine learning model interpretation..This article should help you leverage the state-of-the-art tools and techniques which should help you in your journey on the road towards Explanable AI (XAI)..Based on the concepts and techniques we learnt in Part 2, in this article, we actually implemented them all on a complex machine learning ensemble model trained on a real-world dataset..I encourage you to try out some of these frameworks with your own models and datasets and explore the world of model interpretation!What’s next?In Part 4 of this series, we will be looking at a comprehensive guide to building interpreting models on unstructured data like text and maybe even deep learning models!Hands-on Model Interpretation on Unstructured DatasetsAdvanced Model Interpretation on Deep Learning ModelsStay tuned for some interesting content!Note: There are a lot of rapid developments in this area including a lot of new tools and frameworks being released over time..In case you want me to cover any other popular frameworks, feel free to reach out to me..I’m definitely interested and will be starting by taking a look into H2O’s model interpretation capabilities some time in the future.The code used in this article is available on my GitHub and also as an interactive Jupyter Notebook.Check out ‘Part 1 — The Importance of Human Interpretable Machine Learning’ which covers the what and why of human interpretable machine learning and the need and importance of model interpretation along with its scope and criteria in case you haven’t!Also Part 2 — Model Interpretation Strategies’ which covers the how of human interpretable machine learning where we look at essential concepts pertaining to major strategies for model interpretation.Have feedback for me?.Or interested in working with me on research, data science, artificial intelligence or even publishing an article on TDS?.You can reach out to me on LinkedIn.Dipanjan Sarkar – AI Consultant & Data Science Mentor – Springboard | LinkedInView Dipanjan Sarkar's profile on LinkedIn, the world's largest professional community..Dipanjan has 2 jobs listed on…www.linkedin.com. More details

Leave a Reply