Two Visualization techniques for Models

  • Partial Dependence Plots PDP’s help explain relation of individual features vs. model

  • Shapley Value Plots SHAP plots help explain individual predictions

Coefficients from linear models can be used to generate these.

Intro

Links to cool points

Partial Dependence Plots

PDP’s can be used to relate one or two independent variables to the dependent variable. The limitation to two is only because visualization of more than three variables is hard.

What does a line plot of a PDP for one independent variable look like?

PDP line plot

What does a heat map of a PDP for two independent variables look like?

PDP heat map

Start of PDP code

3D surface plot PDP

Code

Code, Linear Regression and R^2 score

Linear Regression Coefficients

Linear regression models will miss non-linearities.

Gradient Boosting Model

Gradient Boost models can better fit non-linearities, but then do not produce coefficients.

PDP purpose

NB: Whether to use training data or validation data or combination is not currently decided.

Explanatory animation

On the animation, lines joining points of a color are ICE curves (Individual Conditional Expectation).

PDP with one feature

  • module pdpbox.pdp

  • functions

    • pdp_isolate_ and
    • pdp_plot

Instructions for Build Week