Skip to content

Local explanations notebook

A marimo notebook that explains single predictions of the Titanic EBM. It is the best place to learn the feature by using it: pick a passenger, move the confidence slider, see the three explanations change, check the guarantees by brute force, and compare what the LLM reads for a layperson and a data scientist.

  • Everything up to "Put it in words" runs without an API key: it computes and shows the facts.
  • The last cells call the LLM (the global explanation, then the three local ones) and only run when you press their button. The default model needs OPENROUTER_API_KEY. Pass model= to use another model, see Choosing the model.

The page below is the notebook with the output of its cells, exported when the docs are built. To run it:

uv run marimo edit notebooks/local_explanations.py

New to the package? Start with the Titanic notebook, which makes the global explanation this notebook builds on. The guide explains the ideas.

Open the notebook in its own page