Skip to main content

Unified evaluation and explainability framework for ML models

Project description

📊 ExplainEval

ExplainEval is a unified evaluation and explainability framework for machine learning models. It supports classification, regression, NLP, and time series tasks, providing a consistent API to evaluate models, explain predictions, and generate interactive reports.


🚀 Features

  • ✅ Easy evaluation for Classification, Regression, NLP, and Time Series models
  • 🔍 Built-in explainability using SHAP and LIME
  • 📊 Confusion matrix, ROC curves, MAE, RMSE, and more
  • 📋 Auto-generated HTML reports for stakeholders
  • 🔁 Model comparison interface
  • 📦 Compatible with scikit-learn, XGBoost, LightGBM, Transformers

📦 Installation

Install via PyPI:

pip install explaineval

Or install from source:

git clone https://github.com/yourname/explaineval.git
cd explaineval
pip install -e .

🔧 Supported Tasks

Task Type Models Supported Explainability
Classification scikit-learn, XGBoost, LightGBM, etc. SHAP, LIME
Regression Linear, Tree-based, Boosting, etc. SHAP
NLP Sklearn Pipelines, Transformers SHAP, Attention
Time Series ARIMA, LSTM, XGBoost, etc. SHAP

🧠 Usage Example

🔍 Classification Example

from explaineval.main import EvalX
from sklearn.datasets import load_iris
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split

X, y = load_iris(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
model = RandomForestClassifier().fit(X_train, y_train)

evalx = EvalX(model, task="classification", background_data=X_train)
evalx.evaluate(X_test, y_test)
evalx.explain(X_test[:5])
evalx.generate_report("classification_report.html")

📈 Regression Example

from sklearn.datasets import load_diabetes
from sklearn.ensemble import GradientBoostingRegressor

X, y = load_diabetes(return_X_y=True)
model = GradientBoostingRegressor().fit(X, y)
evalx = EvalX(model, task="regression", background_data=X)
evalx.evaluate(X, y)
evalx.explain(X[:5])
evalx.generate_report("regression_report.html")

📋 Auto Reports

Call generate_report("filename.html") to save a clean HTML report including:

  • Task summary
  • Evaluation metrics
  • SHAP/LIME explanation visualizations

🧪 Model Comparison

from sklearn.ensemble import RandomForestClassifier, GradientBoostingClassifier

model1 = RandomForestClassifier().fit(X_train, y_train)
model2 = GradientBoostingClassifier().fit(X_train, y_train)

results = evalx.compare([model1, model2], X_test, y_test)
print(results)

📄 License

MIT License © 2025 Shaheer Zaman Khan


🤝 Contributing

We welcome contributions! To contribute:

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/YourFeature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/YourFeature)
  5. Open a pull request

📬 Contact

Have questions or feedback? Open an issue or contact us at shaheerzk01@gmail.com

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

explaineval-0.2.4.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

explaineval-0.2.4-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file explaineval-0.2.4.tar.gz.

File metadata

  • Download URL: explaineval-0.2.4.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for explaineval-0.2.4.tar.gz
Algorithm Hash digest
SHA256 2aee6ef3db8690f21957d7629e4c8387773f44deb267c1783c4f23309e46a994
MD5 9fbea89d6bf6bd57f5951bfc69857621
BLAKE2b-256 2031c5c2e017a716eba5fe11c05767030e174d3098e19dc7d472947a0cb44b04

See more details on using hashes here.

File details

Details for the file explaineval-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: explaineval-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for explaineval-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 73f189648910867a46e073ef782ec5ac3c1e9c7a97a3a4f3ebc3d8e8c5a5db7e
MD5 4546056ea8530739e9ff678f09277602
BLAKE2b-256 b0b2a5b61b7c0498b50f70557d937a43d577f2256908dc77d4af6b0197683423

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