Explainable Machine Learning
By: Giorgio Visani
Tags: Interpretability, Explainable Ai, Machine Learning, Explainability, Model Explanation

Approaches to Interpretability

There are basically two approaches to achieve Interpretability:

you may actually build a Transparent ML model (one which is understandable without further intervention)

(one which is understandable without further intervention) or you could use a black-box model ad apply a Post-Hoc technique on top of it, to explain its very complex behavior

Transparent Models

Nowadays the Transparent ML world is a hot research topic (if interested I suggest to read some of Cynthia Rudin’s works like [6], as well as[1] from Alvarez-Melis), however, they don’t look like being ready to replace complex black-box models, which have been studied for the last 20 years and are proven to be very good for many tasks.

Moreover, I bet it is more trendy to use a very complex Gradient Boosting or Neural Network model, instead of classical Logistic Regression or Decision Trees (it is also a way to impress your client with new powerful stuff).

Post-Hoc Techniques

Said so, here we are going to focus on Post-Hoc Techniques, i.e. explanation methods that work on top of complex black-box methods. So that anyone can have fun with the ML model he prefers.

Post-Hoc Methods are partitioned following two main concepts: Model Agnostic/Model Specific and Local/Global techniques.

Model Agnostic techniques work for any kind of ML models, while Model Specific ones rely on a certain model structure. Global methods give an explanation for all the units in the dataset, whereas Local ones just for a bunch of dataset units (but you may always repeat the Local explanation on all the units of interest). Image credits to Stiglic

I’m a big fan of Model Agnostic Techniques: no matter what ML model you used before, they will provide you an explanation for it.

Now, have you ever wondered how it is possible?

Here’s the answer:

Geometrical Interpretation of Prediction models

Basically, each prediction model (be it Machine Learning, Statistical, etc.) draws a prediction function f(x): given a set of x values, it returns the forecasted ŷ.

In the following, I will convince you of this and give some insight regarding the different shapes of prediction functions obtained from different models.

The main reason for using ML is to get insight on how the Y variable changes its values depending on the values of the X variables. So we are assuming Y depends on the Xs (what we’re saying is the Xs are the cause of Y and not the other way around! The direction of the causal relation is not checked in the standard ML models).

All in all, we are interested in the function encoding the dependence between Y and X.

Let’s now consider the variables used in the prediction models.

The first thing that catches the eye is we can turn into numbers almost any kind of info:

images represented as pixels intensity colors ranging from 0 to 255,

represented as pixels intensity colors ranging from 0 to 255, words and text embedded into latent semantic spaces of concepts,

and text embedded into latent semantic spaces of concepts, categories encoded as dummies, etc.

Hence, we only deal with numeric features when the bare ML algorithm is employed! The features in the dataset can be viewed as one dimension of a geometric space, where p is the number of X features in the dataset and the additional dimension is the Y variable.

The observations of our dataset are points in such ℝᵖ⁺¹ space. Therefore, the prediction function f(x) is the surface that best approximates all the points in the geometric space, while at the same time, it represents the best guess about the causal relationship existing between Y and the Xs.

Just to give you a hint of this, I’ll show you some prediction functions f(x) obtained using different ML models: