Skip to main content

ClarivueXAI: Unified Explainable AI Framework

ClarivueXAI is a Python library for explainable AI, providing a unified API to explain models across frameworks (scikit-learn, TensorFlow, PyTorch, custom) and data types (tabular, text, images, time series). Problem Explainable AI is fragmented, with different tools for different models and data types, leading to inconsistent APIs and slower workflows for data scientists and ML engineers. Solution ClarivueXAI unifies XAI with:

A consistent API for all model types and explanation methods. Support for multiple frameworks and data types. Global and local explanations using methods like SHAP, LIME, and Integrated Gradients. Advanced visualization tools, including interactive plots.

See Examples for detailed demonstrations. Key Features

Unified API: Consistent interface for all models. Multi-modal Support: Handles tabular, text, image, and time series data. Framework Agnostic: Supports scikit-learn, TensorFlow, PyTorch, and custom models. Global & Local Explanations: Model-level and instance-level insights. Advanced Visualization: Static and interactive plots, as shown in Wine Classification.

Installation

Base installation

pip install clarivuexai

TensorFlow support

pip install clarivuexai[tensorflow]

PyTorch support

pip install clarivuexai[torch]

All dependencies

pip install clarivuexai[all]

Quick Example This example, inspired by Random Forest Example, shows how to explain a scikit-learn model: from clarivuexai import Model, Explainer from sklearn.ensemble import RandomForestClassifier from sklearn.datasets import load_iris import matplotlib.pyplot as plt

Load data

iris = load_iris() X, y = iris.data, iris.target

Train model

model = RandomForestClassifier(n_estimators=100, random_state=42) model.fit(X, y)

Wrap with ClarivueXAI

cxai_model = Model.from_sklearn(model, feature_names=iris.feature_names)

Create explainer

explainer = Explainer(cxai_model)

Get explanations

global_exp = explainer.explain_global(X, method='shap') local_exp = explainer.explain_local(X[0:1], method='shap')

Visualize

plt.figure(figsize=(10, 6)) global_exp.plot() plt.title("Global SHAP Feature Importance") plt.tight_layout() plt.savefig("global_shap.png")

Documentation Full documentation is available at clarivuexai.readthedocs.io. Key sections:

Quickstart Guide: Basic setup. API Reference: Detailed API docs. Examples: Use cases for tabular, text, image, and time series data.

Contributing Contributions are welcome! Submit a Pull Request on GitHub. License Licensed under the MIT License. See the LICENSE file.

Metadata

Release files for clarivuexai 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clarivuexai 0.1.0
File Size Uploaded
clarivuexai-0.1.0.tar.gz 55.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clarivuexai 0.1.0
File Interpreter ABI Platform
clarivuexai-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 115.2 kB

Release files / clarivuexai-0.1.0.tar.gz

Download URL clarivuexai-0.1.0.tar.gz
Size 55.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d520f7b322b01f954186202494af4e4a3222005eb87a8abd295016c64f122b36
BLAKE2b-256 checksum
How to use checksums
4abcb2dff676ac857c54a1cf1125e2b2878601006b75afe3a1cff29d97b438ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / clarivuexai-0.1.0-py3-none-any.whl

Download URL clarivuexai-0.1.0-py3-none-any.whl
Size 59.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50f85d1765b270fe4c49ed1e07816dbdac01c114720ae366c985853c3a5bc1a1
BLAKE2b-256 checksum
How to use checksums
faef153c87a16fd164a060bd5bfe02fda3899e697fe986fe05bda4497879bdfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page