Skip to main content

A unified framework for explainable AI

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clarivuexai-0.1.0.tar.gz (55.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clarivuexai-0.1.0-py3-none-any.whl (59.5 kB view details)

Uploaded Python 3

File details

Details for the file clarivuexai-0.1.0.tar.gz.

File metadata

  • Download URL: clarivuexai-0.1.0.tar.gz
  • Upload date:
  • Size: 55.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for clarivuexai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d520f7b322b01f954186202494af4e4a3222005eb87a8abd295016c64f122b36
MD5 4e739ec79d364200b63cca300bb0357f
BLAKE2b-256 4abcb2dff676ac857c54a1cf1125e2b2878601006b75afe3a1cff29d97b438ff

See more details on using hashes here.

File details

Details for the file clarivuexai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: clarivuexai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 59.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for clarivuexai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50f85d1765b270fe4c49ed1e07816dbdac01c114720ae366c985853c3a5bc1a1
MD5 c3593dead8577650e7d741dd1e30b4e5
BLAKE2b-256 faef153c87a16fd164a060bd5bfe02fda3899e697fe986fe05bda4497879bdfa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page