Local Interpretable Model-agnostic Explanations (LIME) is a popular Python package for explaining individual model’s predictions for text classifiers or classifiers that act on tables (NumPy arrays of numerical or categorical data) or images. LIME was firstly introduced in the paper called “Why Should I Trust You?”: Explaining the Predictions of Any Classifier” in 2016, and since then LIME project repository hit a point of almost 8k stars (for comparison, scikit-learn has 42k start).
While being one of the most popular approaches for explaining predictions of any classifier, LIME has been several times criticized in the research community: LIME suffers from labels and data shift, explanations dependent on the choice of hyperparameters (yes, LIME has hyperparameters) and even similar points may have different explanations. …
Data scientists need features importances calculations for a variety of tasks. Importances could help us to understand if we have biases in our data or bugs in models. Also, importance is frequently using for understanding the underlying process and making business decisions. Indeed, the model’s top important features may give us inspiration for further feature engineering and provide insights on what is going on.
There are a lot of ways how we could calculate feature importance nowadays. Some of them are based on the model’s type, e.g., coefficients of linear regression, gain importance in tree-based models, or batch norm parameters in neural nets (BN params are often used for NN pruning, i.e., neural network compression; for example, this paper addresses CNN nets, but the same logic could be applicable to fully-connected nets). …
I just finished reading The Clean Coder: A Code of Conduct for Professional Programmers by Robert C. Martin. Incredible book, brand-spanking new coder, ten out of ten. I recommend it to everyone who writes code on a daily basis.
I decided to make some notes that combine advice from the book with some of my own experience in data science and machine learning. I tried to write these notes in an actionable form so it will be easy to make habits from them.