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

Generating LSTM attributions with integrated gradients

We first learned about integrated gradients (IG) in Chapter 8, Visualizing Convolutional Neural Networks. Unlike the other gradient-based attribution methods studied in that chapter, path-integrated gradients is not contingent on convolutional layers, nor is it limited to classification problems. In fact, since it computes the gradients of the output concerning the inputs averaged along the path, the input and output could be anything! It is common to use integrated gradients with CNNs and Recurrent Neural Networks (RNNs), like the one we are interpreting in this chapter. Frankly, when you see an IG LSTM example online, it has an embedding layer and is an NLP classifier, but IG could be used very effectively for LSTMs that even process sounds or genetic data!

The integrated gradient explainer and the explainers that we will use moving forward can access any part of the traffic dataset. First, let's create a generator for...

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 €18.99/month. Cancel anytime