Skip to content

EBaMl

EBaMl explains an Explainable Boosting Machine (EBM) in plain words. An EBM is a glass-box model for tabular data: it adds one learned graph for each feature, so a person can read how each feature moves a prediction. EBaMl gives the graphs and the predictions of an EBM to a large language model (LLM), and returns text that a data scientist, a customer or a regulator can read.

The graph of income in an EBM of synthetic loan data. The score goes up from about -1.6 at low incomes, crosses zero
near 40,000, and stays near +1.3 above 55,000.

  • Describe a model. describe_graph and describe_ebm turn each graph, and the whole model, into a description.
  • Explain one prediction. explain_instance gives a local explanation: what must change to flip the decision, which inputs settle it, and how certain it is. Python computes these facts from the scores of the EBM, and the LLM only puts them in words.
  • Edit a model. EditSession changes the graphs to meet a requirement of the business, with a report and a history.
  • Give the model to an agent. ebaml-mcp is an MCP server with tools to read, explain and edit the model.
  • Use any LLM. The default is the free router of OpenRouter. Pass model= to use OpenAI, Anthropic, Gemini, a local Ollama server or another provider. The LLM gets the graph text and, for a local explanation, the values of the input. To keep the data on your machines, use a local model.

EBaMl is based on TalkToEBM. Python reads the EBM, and BAML holds the prompts and the LLM clients.

Start here

Choose the page for what you need:

  • I do not know what an EBM is


    Learn what an Explainable Boosting Machine is, how it makes a prediction, and what it costs.

    What is an EBM?

  • I must explain decisions to people


    See one prediction go from the model to a text for a layperson, with the facts behind each sentence.

    Why EBaMl?, then Local explanations

  • I know EBMs, and I want the API


    Install the package, describe a graph or a model, and choose the LLM.

    Setup, Usage and API reference

  • I build an agent


    Give an EBM to an agent through the MCP server: tools to read, explain and edit the model.

    MCP server

Quick start

Install the package, and set a free OpenRouter key in your shell:

pip install ebaml
export OPENROUTER_API_KEY=sk-or-...

Fit an EBM, and ask for a description of the graph of its first feature:

from interpret.glassbox import ExplainableBoostingClassifier
from sklearn.datasets import load_breast_cancer

from ebaml import DescribeGraphRequest, describe_graph

X, y = load_breast_cancer(return_X_y=True, as_frame=True)
ebm = ExplainableBoostingClassifier(interactions=0).fit(X, y)
print(describe_graph(DescribeGraphRequest(ebm, feature_index=0)))

The free router picks a model for each request, so the text changes from run to run.

The notebooks show each feature step by step, with the output of each step.

Supported models

Feature Binary classifier Regressor Multiclass classifier Interactions
Graph descriptions (describe_graph) ✅ ✅ ✅ ⚠️
Model summary (describe_ebm) ✅ ✅ ✅ ⚠️
Graph text (EBMGraph) ✅ ✅ ✅ ⚠️
Local explanations (explain_instance) ✅ ✅ ✅ ❌
MCP server (ebaml-mcp) ✅ ✅ ✅ ⚠️
Editing (EditSession) ✅ ✅ ✅ ⚠️

✅ supported. ⚠️ partly supported: the main effects are described, and the interaction terms are skipped. describe_graph and describe_ebm name them in the prompt, so the description says that it leaves them out, and they log an interactions_skipped warning. ❌ not supported yet. Full support is on the roadmap.

How EBaMl differs from TalkToEBM

TalkToEBM builds the prompts in Python and calls OpenAI or Azure directly. EBaMl keeps the Python that has to touch the EBM (extracting and simplifying the graphs) and moves the rest to BAML: the prompts, the LLM clients with their retries, the chain-of-thought pipelines and the token accounting. The pipelines can be tested offline on a scripted client. EBaMl also adds the local explanations, the editing of a model, the MCP server and the choice of the LLM from Python.