Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Interpretable Machine Learning with Python

You're reading from   Interpretable Machine Learning with Python Learn to build interpretable high-performance models with hands-on real-world examples

Arrow left icon
Product type Paperback
Published in Mar 2021
Publisher Packt
ISBN-13 9781800203907
Length 736 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Serg Masís Serg Masís
Author Profile Icon Serg Masís
Serg Masís
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Section 1: Introduction to Machine Learning Interpretation
2. Chapter 1: Interpretation, Interpretability, and Explainability; and Why Does It All Matter? FREE CHAPTER 3. Chapter 2: Key Concepts of Interpretability 4. Chapter 3: Interpretation Challenges 5. Section 2: Mastering Interpretation Methods
6. Chapter 4: Fundamentals of Feature Importance and Impact 7. Chapter 5: Global Model-Agnostic Interpretation Methods 8. Chapter 6: Local Model-Agnostic Interpretation Methods 9. Chapter 7: Anchor and Counterfactual Explanations 10. Chapter 8: Visualizing Convolutional Neural Networks 11. Chapter 9: Interpretation Methods for Multivariate Forecasting and Sensitivity Analysis 12. Section 3:Tuning for Interpretability
13. Chapter 10: Feature Selection and Engineering for Interpretability 14. Chapter 11: Bias Mitigation and Causal Inference Methods 15. Chapter 12: Monotonic Constraints and Model Tuning for Interpretability 16. Chapter 13: Adversarial Robustness 17. Chapter 14: What's Next for Machine Learning Interpretability? 18. Other Books You May Enjoy

What this book covers

Chapter 1, Interpretation, Interpretability, and Explainability; and Why Does It All Matter?, introduces machine learning interpretation and related concepts such as interpretability, explainability, black-box models, and transparency, providing definitions for these terms to avoid ambiguity. We then underpin the value of machine learning interpretability for businesses.

Chapter 2, Key Concepts of Interpretability, uses a cardiovascular disease prediction example to introduce two fundamental concepts (feature importance and decision regions) and the most important taxonomies used to classify interpretation methods. We also detail what elements hinder machine learning interpretability as a primer for what lies ahead.

Chapter 3, Interpretation Challenges, discusses the traditional methods used for machine learning interpretation for both regression and classification with a flight delay prediction problem. We will then examine the limitations of these traditional methods and explain what makes "white-box" models intrinsically interpretable and why we cannot always use white-box models. To answer this question, we consider the trade-off between prediction performance and model interpretability. Finally, we will discover some new "glass-box" models that attempt to not compromise in this trade-off.

Chapter 4, Fundamentals of Feature Importance and Impact, employs a birth order classification example to discuss different methods to obtain feature importance such as those that use a model's intrinsic parameters, and a more reliable model-agnostic method called Permutation Feature Importance. Then, to convey a single feature's marginal impact on the prediction, we will study how to render and interpret Partial Dependence Plots (PDP) and Individual Conditional Expectation (ICE) plots.

Chapter 5, Global Model-Agnostic Interpretation Methods, explores game-theory-inspired SHapley Additive exPlanations (SHAP) in great detail with fuel efficiency regression models, then visualizes conditional marginal distribution Accumulated Local Effects (ALE) plots. Finally, we touch on Global Surrogates, which can be very accurate and efficient interpretation tools when chosen correctly.

Chapter 6, Local Model-Agnostic Interpretation Methods, covers local interpretation methods, explaining a single or a group of predictions. To this end, the chapter covers how to leverage SHAP and Local Interpretable Model-agnostic Explanations (LIME) for local interpretations with a chocolate bar rating example, with both tabular and text data.

Chapter 7, Anchor and Counterfactual Explanations, continues with local model interpretations, but only for classification problems. We use a recidivism risk prediction example to understand how we can explain unfair predictions in a human-interpretable way. This chapter covers Anchors, Counterfactuals, and the Contrastive Explanation Method (CEM), as well as the What-If-Tool (WIT).

Chapter 8, Visualizing Convolutional Neural Networks, exclusively explores interpretation methods that work with Convolutional Neural Network (CNN) models with a fruit classifier model. Once we have grasped how a CNN learns with Activations, we will study several gradient-based attribution methods, such as Saliency Maps, Grad-CAM, and Integrated Gradients to debug class attribution. Lastly, we will extend our attribution debugging know-how with perturbation-based attribution methods such as Occlusion Sensitivity, LIME, and CEM.

Chapter 9, Interpretation Methods for Multivariate Forecasting and Sensitivity Analysis, uses a traffic forecasting problem and Long Short-Term Memory (LSTM) models to look at how to employ Integrated Gradients and SHAP for this use case. Lastly, the chapter looks at how forecasting and uncertainty are intrinsically linked, and sensitivity analysis – a family of methods designed to measure the uncertainty of a model's output in relation to its input. We study two such methods: Morris for factor prioritization and Sobol for factor fixing.

Chapter 10, Feature Selection and Engineering for Interpretability, uses a challenging non-profit direct mailing optimization problem to review filter-based feature selection methods such as Spearman's correlation and learn about embedded methods such as Lasso. Then, you will discover wrapper methods such as Sequential Feature Selection and hybrid ones such as Recursive Feature Elimination, as well as more advanced ones such as Genetic Algorithms. Lastly, even though feature engineering is typically conducted before selection, there's value in exploring feature engineering for many reasons after the dust has settled.

Chapter 11, Bias Mitigation and Causal Inference Methods, takes a credit card default problem to demonstrate leveraging fairness metrics and visualizations to detect undesired bias. Then, the chapter looks at how to reduce it via pre-processing methods such as reweighting and disparate impact remover for in-processing and equalized odds for post-processing. Then, we test treatments for lowering credit card default and leverage causal modeling to determine their average treatment effects (ATE), and conditional average treatment effects (CATE). Finally, we test causal assumptions and the robustness of estimates.

Chapter 12, Monotonic Constraints and Model Tuning for Interpretability, continues with the recidivism risk prediction problem from Chapter 7. We will learn how to place guardrails with feature engineering on the data side and monotonic and interaction constraints on the model to ensure fairness while also learning how to tune a model when there are several objectives.

Chapter 13, Adversarial Robustness, uses a face mask detection problem to cover an end-to-end adversarial solution. An adversary can purposely thwart a model in many ways, but we focus on evasion attacks such as Carlini and Wagner Infinity-Norm and Adversarial Patches and briefly explain other forms of attacks. We explain two defense methods: spatial smoothing preprocessing and adversarial training. Lastly, we demonstrate one robustness evaluation method and one certification method.

Chapter 14, What's Next for Machine Learning Interpretability?, summarizes what was learned in the context of the ecosystem of machine learning interpretability methods. And then speculates on what's to come next!

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime