AI and models · Edition No. 8 · 2 Sep 2026

shap/shap

Per-prediction feature attribution — which of tsfresh's 700 features the surviving model actually leans on, and whether that reason is embarrassing.

← AI and modelsRead the whole edition →

25.7k stars · MIT · v0.53.0rc0 (2026-09-07)

Per-prediction feature attribution — which of tsfresh's 700 features the surviving model actually leans on, and whether that reason is embarrassing.

Repo detailsthe review · specs · pros & cons · install

What it is

The standard library for explaining machine-learning model predictions, assigning each input feature a contribution to each individual output. It works with the gradient-boosted trees and scikit-learn models you would realistically use.

Why it matters

ScalpingMate now has tsfresh generating 700+ features, Optuna searching parameter space aggressively, and arch's reality check to ask whether the winner is luck. What is missing is the question in between: why does the surviving model say buy? SHAP answers it per trade — and the answers are frequently humiliating in a useful way. If your edge turns out to rest on the hour-of-day feature, you have found a session effect, not a pattern; if it rests on a feature computed with future information, you have found a leak that would have cost you real money. For a target as specific as 2% a month, knowing which three features carry the signal is also how you stop retraining on the other 697.

Stars25.7k
LicenceMIT
Latestv0.53.0rc0 (2026-09-07)checked 7 Sep 2026
Written inJupyter Notebook
Needsa GPU
RunsLocally, on your own machine
Setup effort
3 / 5
Payoff
3 / 5
Good
  • TreeExplainer on gradient-boosted models is exact and fast — this is a minutes-not-hours step on your data size.
  • The standard summary and waterfall plots make an abstract question visual, which matters when you are not a statistician.
  • MIT-licensed, so unlike backtesting.py (AGPL) or vectorbt (Commons Clause) it can sit inside a paid feature — "here is why the system took this trade" is a sellable screen.
Watch for
  • It explains the model, not the market. A feature the model leans on can still be pure noise the model has memorised; this narrows where to look, it does not confirm anything.
  • KernelExplainer, the fallback for non-tree models, is slow enough to be impractical on long series. Stay on tree models or budget the time.
  • The API surface is large and the older tutorials use a deprecated interface, so expect some confusion between examples and current docs.
Works well with

6 #12) beside the Optuna trials.

How to get it

A Python dependency in ScalpingMate's virtualenv, run after training and before QuantStats reporting.

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.