xailib.xailib_base

Base classes for XAI-Lib explainability framework.

This module defines the abstract base classes that serve as the foundation for all explainers and explanations in the XAI-Lib library. These classes provide a unified interface for implementing various explanation methods across different data types (tabular, image, text, time series).

Classes:

Explainer: Abstract base class for all explainer implementations. Explanation: Abstract base class for all explanation representations.

Example

Creating a custom explainer:

from xailib.xailib_base import Explainer, Explanation

class MyExplanation(Explanation):
    def getFeaturesImportance(self):
        return self.feature_weights

class MyExplainer(Explainer):
    def fit(self, X, y):
        # Train the explainer
        pass

    def explain(self, x):
        # Generate explanation for instance x
        return MyExplanation()

Classes

Explainer()

Abstract base class for all explainer implementations.

Explanation()

Abstract base class for all explanation representations.