Skip to main content

Reusable XGBoost + SHAP workflow for tabular regression explainability

Project description

EASEai

Python License: MIT Status XGBoost SHAP

Explainable AI for epidemiology and public health.

easeai is a lightweight Python package for tabular regression explainability built around a practical research workflow:

  • XGBoost hyperparameter tuning
  • iterative feature elimination based on XGBoost importance
  • cross-validated RMSE and R²
  • SHAP feature ranking
  • partial dependence plots
  • row-level dominant driver extraction

It was extracted from a county-level environmental health workflow, but the package is intentionally general so others can use it on any tabular regression dataset.

Why use EASEai?

Many research notebooks mix together preprocessing, model tuning, feature selection, evaluation, and explainability in one place. easeai turns that into a reusable package for researchers who want:

  • a quick XGBoost + SHAP baseline
  • interpretable feature ranking
  • reproducible artifact export
  • a cleaner starting point for GitHub or publication-oriented workflows

Installation

pip install -e .

Or after publication:

pip install easeai

Minimal example

import pandas as pd
import easeai as ea


df = pd.read_csv("Alzheimer_merged1.csv", encoding="ISO-8859-1")

workflow = ea.TabularXAIRegressor(
    target="AD_PREV_MEAN",
    drop_columns=["Counties", "FIPS"],
    target_n_features=15,
)

workflow.fit(df)
results = workflow.summarize(id_column="FIPS", name_column="Counties")

print(results.selected_features)
print(results.metrics)
print(results.shap_importance.head())

results.top_drivers[["id", "name", "top_driver"]].to_csv("county_top_drivers.csv", index=False)
workflow.export_artifacts("artifacts")

Package structure

easeai/
  data.py        # preprocessing helpers
  model.py       # tuning, CV, recursive elimination
  explain.py     # SHAP summaries and top-driver extraction
  plotting.py    # SHAP and PDP export helpers
  workflow.py    # end-to-end workflow class

Suggested GitHub topics

xgboost, shap, explainable-ai, tabular-data, epidemiology, public-health, machine-learning, python

Roadmap

  • add classification support
  • add permutation importance
  • add bootstrap confidence intervals
  • add optional map-ready exports
  • publish on PyPI

Development

pytest

License

MIT

Author

Ria A. Martins

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

easeai-0.1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

easeai-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: easeai-0.1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for easeai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 78a367f80a063141eb77af99aa6fb4b1d1d9469e615404551ea4643ea1d4b6eb
MD5 8d8f0a4f0221bd459d21808185580939
BLAKE2b-256 9ee970accf40a2dd8fd6119289fdf2e915124076450da58f422f5a71a48d00eb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: easeai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for easeai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9ab9a01afe1c28b1ad12e5c015bbe4f10c9240fe7bed079511622c839502591
MD5 2eba12c1754c4026cc968359c15d86b5
BLAKE2b-256 db3d8372212585de032bffe84c747c52b9e27f774405936287ed5bdcc33de4cd

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