Text & documents
Numbers & maths
Data & formats
Security
Development & DevOps
Artificial Intelligence
Finance
Health & Wellness
Productivity
Games & Entertainment
Multimedia & design
Business
How to use
How to use it

Choose some data (two examples or your own CSV), train a model and pick a row: you will see why the model predicts what it predicts for that row, with two methods at once. Everything happens in your browser: your data does not leave it and a pasted CSV is not saved.

SHAP

It starts from the average prediction and shares out, among the variables, how far this row is from it. Each variable gets what it contributes on average over all the possible orders in which it could «join» (Shapley values, from game theory). Exact sum: average + contributions = prediction. With up to 10 variables it is computed exactly; with more, by sampling.

LIME

It makes up rows similar to this one (changing some variables to values from other rows), sees what the model predicts and fits a line that imitates it near this row. The line's weights are the explanation. It is fast and easy to read, but approximate: its fidelity says how much the line resembles the model, and with another seed the weights change. Press «Again» and watch.

The examples have a catch

Both examples are synthetic: the data comes from a known formula, so you can check whether the explanation gets it right. Both have a column with no influence at all (day of birth, door number): its importance should come out close to zero. And in the credit one, age goes hand in hand with years in the job: watch how it takes part of the credit without deserving it, which is what happens with correlated variables.

Explain a modelSHAP and LIME on your data: why it predicts what it predicts
Explain a modelWhy it predicts what it predicts: SHAP and LIME, side by side, on your data
Data

Synthetic data: it comes from a known formula, so you can check whether the explanation gets it right (see the help).

600 rows · classification: the probability of «1»

Model

It gets 84% right on rows it has not seen (92.4% on the training rows).

Row 1 of 150 (from the test rows)
ingresos 2,218deuda 10,924anos_trabajo 3edad 32dia_nacimiento 7

The model says:61.3%(actual: 1)

SHAP (exact, 1280 predictions)

From the average prediction to this row's, variable by variable:

average50.8%
ingresos = 2,218+28.8 pp
deuda = 10,924−15.1 pp
edad = 32−2.1 pp
anos_trabajo = 3−1.5 pp
dia_nacimiento = 7+0.2 pp
this row61.3%

LIME

A line that imitates the model near this row. Weight of each variable (green pushes up):

ingresos+27.3 pp
deuda−12.2 pp
edad−4.8 pp
anos_trabajo−2.3 pp
dia_nacimiento+1.6 pp

Fidelity (R² of the line near the row): 0.45, with 600 made-up rows.

SHAP and LIME rank the variables almost the same (ρ = 1).

What matters most overall

The average |SHAP| of each variable over 30 test rows.

ingresos23 pp
deuda9 pp
anos_trabajo1.2 pp
dia_nacimiento0.7 pp
edad0.6 pp

In this data, «dia_nacimiento» has no influence at all in the formula that generated it: if its bar comes out almost empty, the explanation got it right.