Shows the prediction for a single sample over all possible values that a variable of interest can take.
Sample explanation for a categorical variable.

What are we trying to explain?

This explanation shows the prediction for a single sample over all possible values a variable can take.

Why is it useful?

Information from this explanation can be used for different purposes.

For business

  • Evaluate business actions on-the-fly: getting to know what would happen in advance can help you make better decisions. Stop relying on your intuitions.

  • Increase profits: validate actions that will increase your profits.

  • Model validation: using previously known samples, you can validate whether your model works properly.

For developers

  • Further insights: get to know the models you are designing.

How we do it

This explanation is explained in detail in Goldestein et al. (2015). In this section, we sum it up so that anyone can understand the idea behind our algorithms.

Plain English

The intuition is quite simple. What is the prediction for every possible value of a variable? Basically, we can create a sample for each potential combination and run the model to get the actual prediction.

More formally


  • f(X)f(X)be the model we are trying to explain.

  • XX be the matrix containing input data for the model with samples called xx

  • JJ be the explained variable at the j-th column of X.

The idea is quite simple as presented in Plain English. Formally, we say that the function h()h()that represents these potential predictions for sample xix_i is defined as:

hxij(z)=f(xij=z)h_{x_i}^j(z) = f(x_i^{j|=z})

Where zz takes all possible values for variable JJ


Goldstein, Alex, Adam Kapelner, Justin Bleich, and Emil Pitkin. 2015. “Peeking Inside the Black Box: Visualizing Statistical Learning with Plots of Individual Conditional Expectation.” Journal of Computational and Graphical Statistics 24 (1): 44–65. https://doi.org/10.1080/10618600.2014.907095.