AI Model Explainability and Interpretability Tool
Project description
Thinxai
A CLI tool for explaining deep learning models. Provide it with a trained model + training dataset with target and it generates a PDF report telling what drives predictions and why.
Install
pip install thinxai
With extras:
pip install thinxai[tensorflow] # TensorFlow/Keras models
pip install thinxai[gpu] # GPU acceleration
pip install thinxai[all] # all extras
Quick Start
- Place your model file and CSV dataset in the same folder
- Run:
thinxai
Or:
python -m thinxai
- Select your model and dataset from the interactive menu
- Find the PDF report in the same folder
Supported Inputs
Deep Learning Models: PyTorch (.pth, .pt, .pkl), TensorFlow/Keras (.h5, .hdf5, .keras, SavedModel), Transformers (BERT, GPT, etc.), ONNX (.onnx)
Also Supported: Scikit-learn (.pkl, .joblib)
Data: CSV, tab-delimited, pipe-delimited
What It Does
Thinxai runs multiple explainability methods on your model and combines the results into a single ranked list. It then generates plain English explanations for the top features and packages everything into a PDF report.
Analysis Pipeline
- Permutation Importance: shuffles each feature and measures accuracy drop
- SHAP Values: game-theoretic attribution per prediction
- Integrated Gradients: gradient-based attribution along the input path
- Statistical Tests: mutual information and F-scores
- Built-in Importance: model native scores when available
These are merged into a consensus score. Features that rank highly across multiple methods get higher confidence.
Explanations
Top features are explained by a cascade LLM system:
- Groq API: Primary
- HuggingFace fallback: Secondary
- Rule-based fallback: Always works
Each explanation includes a business insight
PDF Report Contents
- Cover page with model validation metrics and trust indicator
- Feature importance distribution pie chart
- Each feature gets explanation cards with business insights
- Executive summary with the top 3 features
- Technical glossary automatically generated from terms found in the report
Trust Indicators
The tool flags suspicious results:
- Accuracy >99%: warns about possible data leakage
- Accuracy near random: warns model may not have learned patterns
- Raw state_dict models: skips validation, runs statistical analysis only
Requirements
- Python 3.8+
- See
setup.pyfor full dependency list
Documentation
README.md— this fileQUICKREF.md— how to run thisLICENSE— MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file thinxai-1.0.3.tar.gz.
File metadata
- Download URL: thinxai-1.0.3.tar.gz
- Upload date:
- Size: 38.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3bebfb0c9fadbf963f0a009165d4c98939a66cf05aca93cf35d3bec38d8a538
|
|
| MD5 |
123df811f588c45bc5451ce6039cee3a
|
|
| BLAKE2b-256 |
8dc9d666beb672cddccb5a8a0fd434074be0de29d00c8a60c0bb7b855ec8a4a4
|
File details
Details for the file thinxai-1.0.3-py3-none-any.whl.
File metadata
- Download URL: thinxai-1.0.3-py3-none-any.whl
- Upload date:
- Size: 38.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa24260e3cf9d4b72633672c20d55bdbda561cba5bc0f981d71e53d692288c67
|
|
| MD5 |
0f7882c81e25f81dba7757eca900ccfe
|
|
| BLAKE2b-256 |
79a37ccd713ef715608ddcf437994f7743839d8359775d2236b6ad7a6d9fda6a
|