Explainability Example¶
Following the code from Basic Usage.
Initializing¶
import shap
from infodeslib.des.knorau import KNORAU
colors = {0: 'red', 1: 'green'}
knorau = KNORAU(model_pool, feature_sets, k=7, colors=colors)
knorau.fit(X_dsel, y_dsel)
Selecting one instance¶
index = 18
query = X_test.iloc[[index]]
## Make plot=True
knorau.predict(query, plot=True)
Estimating Region of competence (RoC) in validation dataset
Detailed information about the selected samples in RoC:
The contribution of each selected classifier on the final decision:
The local feature importance of each selected classifier: