Skip to main content
Nori is accurate but, like any deep model, a black box. NoriInterpreter turns it into a standalone glass-box Explainable Boosting Machine (EBM / GA²M) — an additive model whose entire decision logic is a set of readable per-feature curves. You keep most of Nori’s accuracy but get a model you can inspect, ship, and audit line by line, which is often what a review or a regulated deployment actually needs. examples/explainability_credit.py
Needs the interpretability extra (shapiq, interpret-core, joblib, scipy), which covers the whole glass-box workflow.

How it works

A single fit(X, y) runs three steps and stores every artifact:
1

Measure importance

Fit Nori and score each raw input column by permutation importance — the drop in held-out skill when that column is shuffled.
2

Prune to what matters

Drop the low-importance columns, keeping the smallest subset that still retains ≥ retain (default 95%) of Nori’s skill.
3

Distill a glass-box

Fit an EBM on the surviving features. It learns one shape function per feature (plus a few pairwise interactions), so the whole model reads as baseline + Σ per-feature contributions.
The task (regression or classification) is auto-detected — Nori itself stays regression-only and scores the pruning, while the distilled EBM matches the target type.

Quickstart

Worked example — UCI Credit Default

examples/explainability_credit.py runs the full flow on the UCI Credit Default table (23 features, ~30k rows, downloaded fresh). The permutation ranking is dominated by PAY_0 — the most recent repayment status — with the credit limit and earlier repayment months trailing it:
Nori feature importance bar chart for the credit-default dataset

Nori-permutation importance (top 10). PAY_0 — the latest repayment status — carries most of the signal; importance = drop in test AUC when that column is shuffled.

Pruning keeps 7 of 23 features at the 95% bar, and distilling those into an EBM costs very little: Nori scores AUC 0.781 on all features, and the glass-box EBM reaches 0.766 on the 7 it kept. The distilled model is fully legible — each middle panel is one feature’s contribution to the predicted default probability, the right-hand heatmaps are pairwise interactions, and the Σ → σ node adds the baseline and every contribution into the final prediction:
Glass-box EBM model diagram distilled from Nori on the credit-default dataset

The distilled glass-box EBM (7 features, test AUC 0.766). Read left-to-right: each shape function maps a feature's value to how much it pushes default probability up (+) or down (−); grey bars show where the data is dense (trustworthy) vs sparse (extrapolated); Σ then σ combine the baseline and all contributions into ŷ.

Causal view: drivers vs. proxies

Importance says which features Nori relies on; it does not say which way the dependence runs. A feature can be important because it drives the target, or because the target drives it (a proxy, such as a reading taken after the outcome). causal=True adds a second, zero-shot model, NoriCausal, that reads the table once and scores both directions for every feature:
  • p_cause is P(feature → target): the probability of a direct edge into the target.
  • p_effect is P(target → feature): the probability that the target directly drives the feature.
  • causal_adjacency_ holds the same probabilities for every pair, features included; causal_ranking_ is its target row and column, sorted by p_cause.
On the sklearn diabetes table (target: disease progression after one year), s5 (serum triglycerides) and bmi stand out as likely causes, and the features Nori barely uses score low in both directions:
Horizontal bar chart of cause and effect probabilities per diabetes feature; s5 (0.78) and bmi (0.60) have the highest cause probabilities

NoriCausal on diabetes. Blue: probability that the feature directly causes progression; orange: probability that progression directly causes the feature. No cutoff is applied: these are scores to rank and compare.

Read the two bars together. A feature with high importance, a high p_effect and a low p_cause is more likely a proxy of the target than a lever on it. The scores are evidence to check, not conclusions: here age leans toward “effect”, which cannot be right (progression does not change age), a reminder that the model infers direction from distributional patterns alone. plot_causal_graph() shows the same relations as a graph: the target in the centre, each feature’s more probable direction as an arrow, labelled with its probability. Arrows at 0.5 or above are solid; weaker ones are dashed, because the model leans neither way for them.
Star graph with progression in the centre: solid orange arrows from s5 (0.78) and bmi (0.60) into progression, and dashed grey arrows with probabilities below 0.5 for the other eight features

interp.plot_causal_graph() on diabetes. Only s5 (0.78) and bmi (0.60) are likely causes of progression; every other feature is below 0.5 in both directions (dashed). The dashed arrows' directions are unreliable: age, sex and bp are measured at baseline, a year before the outcome, so progression cannot cause them.

The causal view is regression-only: fit raises for classification targets. The output is probabilities, not a graph; no cutoff is applied. Weights (~30M parameters) download from the Hugging Face Hub on first use. Up to 25 features the table is read in one pass; wider tables are read as 30-column subsets with the target in every subset that contains it, until each feature has been read with the target at least 3 times (target_coverage).

Configuration

For finer control, the same steps are exposed as standalone functions — import from the submodules: interpretability.glassbox.importance (nori_permutation_importance, nori_shap_importance), interpretability.glassbox.ebm (fit_ebm, ebm_structure), and interpretability.glassbox.pipeline (run, the end-to-end importance → EBM driver). NoriCausal is also usable on its own: synthefy_nori.causal.NoriCausal().fit(X, y) returns the edge-probability matrix as adjacency_ (y is optional).

Good to know

  • Runs on the local Python package (synthefy-nori), not the hosted API.
  • Nori remains the source of truth for accuracy — the EBM is a faithful, auditable approximation on the selected features, so expect a small score gap (≈0.01 AUC on the credit example).
  • For single-prediction attributions, feature interactions, and partial dependence, see Explainability.

Next steps

Explainability

SHAP / Shapley values, interactions, PDP, and feature selection.

Categorical & Ordinal Targets

Predict labels on a discrete scale instead of a continuous estimate.