7 years ago I started writing the book Interpretable Machine Learning. It’s still one of my main sources of income. But over time I started to hate working on it.
2.5 years ago I finished my PhD and decided to become a full-time writer. My first project: Finishing the 2nd edition of Interpretable Machine Learning. After that, I was ready for new projects without interpretability, like writing Modeling Mindsets. After that, the topic of interpretability was no longer that interesting to me. It probably had something to do with my PhD, which dragged on towards the end and kind of burned me out. So after the release of the 2nd edition, I didn’t feel like touching the book. I ignored Github issues and pull requests. I ignored the corrections sent to me by email. I didn’t write any new chapters. But it was more than that.
The other problem was the book itself, or rather the technical debt it had accumulated. I wrote the book in R bookdown and in the beginning, I only published the online version of the book in progress. When it became clear that many people were looking forward to reading the book, I started working on an ebook version. I decided to go with Leanpub. Leanpub allows you to upload PDF and epub files directly, or upload the markdown files and let Leanpub render the book for you. I chose the latter. Huge mistake in hindsight, because a lot of the technical debt of the book is geared towards making bookdown format bend to Leanpub. Rendering the book on Leanpub was such a hassle because it would throw mysterious errors without much additional information. So the process was a lot of trial and error. But the bigger long-term problem was the many little hacks to make the rendering work. For example, I built the references from the footnotes, for which I had a separate script. I had to write a script to convert the markdown files to the Leanpub flavor of markdown. I couldn’t reference figures from the text, so I had to make sure the figures always followed directly after the mention in the text, which did not always work. For reasons I don’t remember, I also couldn’t have whitespaces in the math formulas (like $$\hat{f}(x)=\beta_0+\beta_1x_1$$).
But the book was much messier than that. For example, every chapter has examples. Instead of training the models for the examples in one place, I train them separately in each chapter, so the interpretation is about slightly different models each time. Also, I was no longer happy with the examples, especially the cancer classification. And other things I just could not get behind anymore: In the book, I say so many times to check the correlation! But for the examples, I don’t even check the correlation myself. I didn’t even measure the performance of the models …. That really didn’t sit right with me. In the feature importance chapter, there is this sentence: "I based the importance computation on the training data, because I had to choose one, and using the training data needed a few lines less code.” What the hell, past me?? I could go on, like inconsistent math, a weird and long discussion about whether to use training or test data for permutation feature importance and more.
All in all, awkward and brittle. And the longer I didn’t work on the book, the less I wanted to touch it. Maybe you know this feeling from one of your projects.
Anyway, a few months ago, I decided to change that. Clean up the book. Make it a new edition that I can stand behind again and that doesn’t give me dread when I think about it. The 3rd edition of Interpretable Machine Learning includes a few new chapters and an update of the content. But most importantly for me a move from bookdown to Quarto for rendering the book and a huge cleanup of the “code” base of the book, if you want to call it that.
You can read more about the new version here:
The new version is planned for March 2025. I have already found a new joy in working on the book. I’m looking forward to the release and the easier maintenance afterward. This will make the book project much more future-proof, at least from the technical side of things.