Interpreting Results
After calling an explainer, FDFI returns two kinds of objects: the results
dictionary from explainer(X_test) and the confidence-interval
dictionary from explainer.conf_int(). This page explains what every key
means and when to prefer X-space versus Z-space attribution.
The Results Dictionary
Calling any working explainer returns a dict with the following keys:
Key |
Shape |
Description |
|---|---|---|
|
|
Mean UEIF (Unit Effect Independent Feature) in the original feature space. Summarises how much each original feature contributes to prediction variance across the test set. |
|
|
Standard error of |
|
|
Standard deviation of per-sample UEIFs in X-space ( |
|
|
Mean UEIF in the latent (disentangled) space. Because features are
approximately independent in Z-space, each |
|
|
Standard error of |
|
|
Standard deviation of per-sample UEIFs in Z-space. |
Per-Sample UEIFs
After calling explainer(X_test) the explainer also stores per-sample
attributions as instance attributes:
explainer.ueifs_X— shape(n_test, d)explainer.ueifs_Z— shape(n_test, d)
These are used by summary_plot() (beeswarm),
waterfall_plot(), force_plot(),
dependence_plot(), and
conf_int() with groups=.
results = explainer(X_test)
# Global bar chart
from fdfi.plots import summary_bar, summary_plot
summary_bar(results["phi_X"], results["se_X"], feature_names=feature_names)
# Per-sample beeswarm
summary_plot(explainer.ueifs_X, features=X_test, feature_names=feature_names)
X-space vs. Z-space
Both spaces answer different questions:
Attribute |
When to prefer it |
|---|---|
|
Importance of the original observed features. Accounts for the correlation structure (correlated features share credit via the Jacobian). Use this for feature selection, model debugging, and reporting to stakeholders. |
|
Importance of the latent independent dimensions. Each dimension’s contribution is orthogonal to all others. Use this for theoretical analysis or when you specifically want correlation-free attribution. |
The conf_int() Dictionary
conf_int() returns a dict with the
following keys (arrays have length d for feature-level output, or length
G for group-level output):
Key |
Type |
Description |
|---|---|---|
|
|
Estimated feature importance — the mean UEIF (after optional null thresholding). This is the point estimate used as the centre of the CI. |
|
|
Standard error after variance-floor regularisation. The floor prevents near-zero SEs from inflating z-scores for unimportant features. |
|
|
Signed z-statistic: |
|
|
Rank by descending z-score; |
|
|
Lower confidence-interval bound. |
|
|
Upper confidence-interval bound. |
|
|
|
|
|
One- or two-sided p-value depending on |
|
|
Multiple-testing-adjusted p-value. Present only when
|
|
|
The null-hypothesis threshold used. |
|
|
How the margin was selected: |
|
|
|
|
|
Group names. Present only when |
ci = explainer.conf_int(alpha=0.05, alternative="greater")
import numpy as np
significant = np.where(ci["reject_null"])[0]
print("Significant features:", significant)
print("z-scores:", ci["zscore"][significant].round(2))
print("p-values:", ci["pvalue"][significant].round(4))
Reading Diagnostics
After initialisation, disentangled explainers (OTExplainer,
EOTExplainer, FlowExplainer) populate explainer.diagnostics. Call
diagnose() to recompute on a custom subset.
Key |
Meaning |
|---|---|
|
Median off-diagonal dCor. Lower is better (features more independent). |
|
|
|
MMD between background and reconstructed distributions. |
|
|
A 'POOR' disentanglement label means the latent space is not well
decorrelated; X-space and Z-space attributions may both be unreliable. Try
EOTExplainer or
FlowExplainer for potentially better disentanglement.
See also
Statistical Inference with FDFI — detailed guidance on confidence intervals, one-sided tests, variance floors, and FDR correction.
Choosing an Explainer — when to use each explainer class.