Skip to Content

Out-of-fold explainability

Current mllabiome explainability is out-of-fold by default. This is the recommended mechanism for nested-CV and LODO experiments.

Principle

Every explained row is explained using a model that was not fitted on that row.

For MPMA-B, Baseline RF, and specific MPMA targets:

outer train → fit transformation → fit learner outer test → transform with the train-fitted transformation → explain

For MPMA-E:

for each outer fold: fit each selected member on outer train predict/explain outer test aggregate member predictions with the selected ensemble rule

Methods

By default, the configured target is explained using:

MethodOOF behavior
SHAPBackground from the outer-training fold; explained rows from the outer-test fold
LIMEExplainer fitted on outer-training transformed data; local explanations for outer-test rows
Permutation importanceComputed on the outer-test fold with y_test
ALEFold-fitted model and outer-test matrix; sparse features that are constant in a fold are skipped for that fold only
InteractionsTwo-dimensional ALE interaction analysis, aggregated across folds

The package does not silently replace a requested method with another method. If a dependency is missing or the selected target cannot be explained, the explainability stage fails. Sparse ALE features are not a fallback case: they are recorded as not estimable for the affected fold and reported in diagnostics.

Target selection

EXPLAINABILITY = mll.Explainability(targets="auto", top_k=30)

targets="auto" runs:

MPMA-E, when selected_unit.json exists MPMA-B strict Baseline RF, when the required baseline exists

Specific target examples:

# Best individual MPMA only EXPLAINABILITY = mll.Explainability(targets=("mpma_b",), top_k=30) # Selected ensemble only EXPLAINABILITY = mll.Explainability(targets=("mpma_e",), top_k=30) # Strict baseline RF only EXPLAINABILITY = mll.Explainability(targets=("baseline_rf",), top_k=30) # Specific config ID EXPLAINABILITY = mll.Explainability(targets=("48e21e491927",), top_k=30)

Important output files

FileMeaning
feature_importance.tsvConsensus importance table across configured methods
feature_importance_<method>.tsvMethod-specific importance table
oof_predictions.tsvOut-of-fold predictions used by explainability
explained_unit.jsonMetadata for the explained target, including OOF status
ale_skipped_features.tsvSparse features/folds where ALE was not estimable, if any
feature_interactions_by_target_all_methods.csvInteraction summary by target and method
Last updated on