Quickstart

This notebook demonstrates the simplest workflow: load models, create an ExplainToolkit, compute an explanation, and plot it.

[ ]:
import skexplain
[ ]:
estimators = skexplain.load_models()
X, y = skexplain.load_data()

print(estimators)
print(f'X Shape : {X.shape}')
print(f'y Skew : {y.mean()*100:.1f}%')
[ ]:
explainer = skexplain.ExplainToolkit(estimators=estimators, X=X, y=y)

Compute Permutation Importance

The simplest explanation method — how much does model performance drop when a feature is shuffled?

[ ]:
perm_imp = explainer.permutation_importance(n_vars=10, evaluation_fn='norm_aupdc')
[ ]:
explainer.plot_importance(data=perm_imp, panels=[('multipass', 'Random Forest')])

Compute ALE Curves

Accumulated Local Effects show how each feature affects predictions.

[ ]:
ale = explainer.ale(features=['sfc_temp', 'temp2m', 'dwpt2m', 'sat_irbt'], n_bins=20)
[ ]:
explainer.plot_ale(ale=ale)

Next Steps

Explore the other notebooks for deeper dives into each method.