xailib.xailib_tabular

Tabular data explainability classes for XAI-Lib.

This module provides base classes for explaining predictions on tabular (structured) data. It extends the base Explainer and Explanation classes with tabular-specific functionality, including interactive feature importance visualization.

Tabular data explanations are commonly used for:
  • Understanding feature contributions to predictions

  • Generating human-readable decision rules

  • Identifying similar and contrasting examples

  • Creating counterfactual explanations

Classes:

TabularExplanation: Base class for tabular data explanations. TabularExplainer: Base class for tabular data explainers.

Example

Using LIME for tabular explanation:

from xailib.explainers.lime_explainer import LimeXAITabularExplainer
from xailib.models.sklearn_classifier_wrapper import sklearn_classifier_wrapper

# Wrap your model
bb = sklearn_classifier_wrapper(your_sklearn_model)

# Create and fit explainer
explainer = LimeXAITabularExplainer(bb)
explainer.fit(df, 'target_column', config={})

# Generate explanation
explanation = explainer.explain(instance)
explanation.plot_features_importance()

See also

xailib.explainers.lime_explainer: LIME implementation for tabular data. xailib.explainers.shap_explainer_tab: SHAP implementation for tabular data. xailib.explainers.lore_explainer: LORE implementation for tabular data.

Classes

TabularExplainer()

Abstract base class for tabular data explainers.

TabularExplanation()

Abstract base class for tabular data explanations.