Sanity Checks - How Linear Regression Outperforms Boosted Trees
By: Bassel Karami
Tags: Data Science, Xgboost, Linear Regression, Model Interpretability, Machine Learning

Introduction

Gradient boosted trees have been widely used to win several competitions on Kaggle. It is no surprise that for most tabular datasets you are working with, you would likely find XGBoost or another implementation of boosted decision trees as the model with the best cross-validation score on your metric(s).

Question — How many times have you deployed a gradient boosted trees model with a supposedly good cross-validation score, but your end users questioned the validity of predictions?

Did you explain away the unexpected prediction using LIME or SHAP?

SHAP values showing how a grade of 8 contributed to a roughly USD 100k reduction in estimate house value (screenshot by author)

In the above example where house price was estimated using a decision tree regressor, SHAP can help explain how having more than 4,000 sqft of living room, a waterfront, and a good view increased the estimated value of the house, whereas its grade of 8 decreases its estimated value.

If you haven’t used SHAP before, red = increases estimated price, blue = reduces estimated price.

SHAP values showing how a grade of 8 increases estimated house value by ~ USD 50k instead of reducing its value (screenshot by author)

In the next example, a grade of 8 actually increases the estimated value of the house. While one can conceive how a grade of 8 may be good/bad conditional on other variables, this is difficult to explain to a typical user of your house price prediction model.

Even worse is, if in the 2nd example, we ran a counterfactual where that same house, with the same features, had a better grade of 9 instead of 8, its estimated value would be go down from USD 1.31 mln to 622k!! Try to explain that away to a user of your house price prediction model.

There is no bug in the decision tree regressor used in the above examples. Tree-based models are trained by default to greedily increase information gain at each split without considering such sanity checks.

In a linear regression model, for example, we at least have a parametric model with some form of “structure” to the prediction logic in the form of assuming a linear, monotonic, relationship between each explanatory variable/feature and the target (house price in the above examples). This added “structure” would, for e.g. help ensure that an increase in grade only increases the estimated price of a house (monotonicity). It can also be more easily controlled to enforce rules such as feature A should cannot have a larger impact on price compared to feature B, where we simply have to ensure the coefficients of the linear regression are aligned with our business rules and common intuition. This makes the behaviour of the system, i.e. linear regression, more controllable since this parametric structure can be modified.

Controllability is an innate attribute of model interpretability.

Explainability of results is not equivalent to interpretability. I sometimes see Decision Trees placed at the extremely interpretable side of the spectrum, even more than linear regression, and I would argue that this should not be the case. If I am unable to explain to a non-technical person why the model predicted a lower grade house is 2x worth a higher grade house with the same features, the model is not interpretable. That is aside from the very bad user experience this creates and the loss in trust in the model.

When there is a better defined structure embedded in your model, you can better understand the dynamics of your model and you can more easily control your model’s behavior. In the below sections, I want to demonstrate how prevalent is the failure in sanity checks and how having a more controllable model can help.