# How to measure variable contribution to an observation in a non-linear model?

Based on my model, if I decline someone due to their score, it should be able to provide some reasoning as to which variables mainly contributed to the decision to decline.

Typically in Logistic Regression models, this is a simple exercise where you calculate (Beta * X) for each variable and pick 1 or 2 variables which caused the biggest score drop.

However, this isn't very straightforward for non-linear models. I would appreciate any ideas on handling something like this. Thanks.

• DO you mean saying something like "If you could improve your $X$ and $Y$ a little bit, that would help immensely, but don't worry so much about $Z$," or getting confidence intervals (or p-values) on the parameters of a nonlinear regression equation?
– Dave
Mar 12 '20 at 10:30

## 2 Answers

Try LIME. In other words, compute local representation of your global highly nonlinear model for a given observation. This local proxy should be simple enough to be explainable as well. Decision trees or simple linear regressions are good choices.

Try Eli5

from eli5 import show_weights,show_prediction
show_weights(model)

show_prediction(model,data_point)


Another ways are Lime and SHAP