# InterpretML: A Unified Framework for Machine Learning Interpretability

## What problem does this paper solve?

The paper introduces a new Open Source package called Interpret ML. It also presents a new learning algorithm called Explainable Boosting Machine (EBM).&#x20;

The goal of this package is to unify explainability techniques under a common API. It contains both glass-box models (inherently interpretable ML models) and explainability methods to apply on blackbox algorithms.\
\
In addition to a selection of algorithms, it also provides inbuilt visualisation techniques for ease of comparison and assessment. The package also contains the first implementation of the Explainable Boosting Machine (EBM) algorithm.

## Ideologies & Structure Of The Package

The authors highlight the 4 key design principles they use to design the Interpret ML package-

1. Ease of Comparison\
   Since users want to compare algorithms and see what fits best to their use case, the package is designed to make this comparison seamless with a uniform API.
2. Staying true to the source\
   The implementations of algorithms that are integrated into the package should be accurate and as close as possible to their original implementations. Doing this is not always easy when one is trying to fit all of them in one common API.
3. Play nice with others\
   Building the library on top of tools that are widely adopted by the community and reusing things that exist instead of recreating them. A good example of this is that one is able to get visualizations inside the jupyter notebook itself.
4. Take what you want\
   The end user should be able to extract and use what they find essential to their use case without the overhead of everything else. For instance, in a server on a production environment , one might not need the visualisations and only use the raw values.

The whole package is broadly into two categories of capabilities-

**Glassbox Algorithms**\
Algorithms that inherently produce interpretable and explainable models. The best examples of these are linear models and low depth decision trees. The new addition to this is the Explainable Boosting Machine(EBM) algorithm which is a strong yet inherently interpretable model. The EBM algorithm's experimental performances are found to be at par with models like XGBoost.

{% hint style="info" %}
In common literature, glassbox algorithms are also called whitebox algorithms
{% endhint %}

**Blackbox interpretability algorithms**\
These interpretability algorithms are not the model themselves. Instead, \
these algorithms can explain **any** machine learning/deep learning model. In other words, these are model agnostic explanation algorithms. The package includes the implementation of LIME, SHAP, Partial Dependence Plots, etc under this common API.

The package gives both raw outputs and visualisations if they are needed. The user can choose what kind of outputs they want.\
\
This is the design diagram of Interpret ML\ <br>

![Design Diagram](https://1812151831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDznHRI4hv7seMMHgKm%2F-MFkwC7AzGqs2bWz957q%2F-MFo0TG2rP6mcsudhYpr%2Fimage.png?alt=media\&token=0a5469eb-924f-4cab-98a6-b49109ca2869)

## The EBM Algorithm

The EBM Algorithm is a fast implementation of GA²M algorithm. In turn, GA²M algorithm is an extension of the GAM algorithm. Therefore, let's start with what the GAM algorithm is.

#### GAM Algorithm

\
GAM stands for Generalized Additive Model. It is more flexible than logistic regression, but still interpretable. The hypothesis function for GAM is as follows-

![](https://1812151831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDznHRI4hv7seMMHgKm%2F-MFo0dapU5GnIDg6w_Nb%2F-MFoRm2qK4u-6NTRAC_K%2Fimage.png?alt=media\&token=47530272-bda8-4897-8e07-26d2eb5146a1)

The key part to notice is that instead of a linear term 𝛽ixi for a feature, now we have a function fi(xi). We will come back later to how this function is computed in EBM.

One limitation of GAM is that each feature function is learned independently. This prevents the model from capturing interactions between features and pushes the accuracy down.&#x20;

#### GA²M algorithm

GA²M seeks to improve this. To do so, it also considers some pairwise interaction terms in addition to the function learnt for each feature. This is not an easy problem to solve because there are a larger number of interaction pairs to consider which increases compute time drastically. In GA²M, they use FAST algorithm to pick up useful interactions efficiently. This is the hypothesis function for GA²M. Note the extra pairwise interaction terms.

![](https://1812151831-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MDznHRI4hv7seMMHgKm%2F-MFoRxXiiuqeL6wQ6qk-%2F-MFoSuxScD1UrpwpyFtI%2Fimage.png?alt=media\&token=4896989b-ad8f-4a95-a784-ec8815c2e69f)

By adding pairwise interaction terms, we get a stronger model while still being interpretable. This is because, one can use a heatmap and visualize two features in 2D and their effect on the output clearly. <br>

#### EBM Algorithm&#x20;

\
Finally, let us talk about the EBM algorithm. In EBM, we learn each feature function fi(xi) using methods such as bagging and gradient boosting. To make the learning independent of the order of features, the authors use a very low learning rate and cycle through feature in round robin fashion. The feature function fi for each feature represents how much each feature contributes to the model’s prediction for the problem and is hence directly interpretable. One can plot the individual function for each feature to visualize how it affects the prediction. The pairwise interaction terms can also be visualized on a heatmap as described earlier.

This implementation of EBM is also parallelizable which is invaluable in large scale systems. It also has an added advantage of having an extremely fast inference time.

## Resources

1. [The original paper](https://arxiv.org/abs/1909.09223) - InterpretML: A Unified Framework for Machine Learning Interpretability by Harsha Nori, Samuel Jenkins, Paul Koch, Rich Caruana
2. [Github Repository](https://github.com/interpretml/interpret) - Interpret-ml
3. [Accurate Intelligible Models with Pairwise Interactions(GA²M )](https://www.cs.cornell.edu/~yinlou/papers/lou-kdd13.pdf) by Yin Lou, Rich Caruana,Johannes Gehrke, Giles Hooker.
