icarm
Interpretable, Contextual-Accountable and Responsible Machine Learning for Python
Python port of the icarm R package. Provides a unified pipeline for task-agnostic modelling, explanation, fairness auditing, data drift detection, cross-validation, and accountability reporting.
Installation
pip install icarm
# With extended model support (XGBoost, LightGBM, GAM, SHAP)
pip install "icarm[extended]"
Quick start
from icarm import IcarmModel, icarm_split, load_medical
# Load built-in dataset
df = load_medical()
X = df.drop(columns=["readmitted"])
y = df["readmitted"]
# Split
(X_tr, y_tr), (X_te, y_te) = icarm_split(X, y, prop=0.75)
# Fit (task auto-detected: binary)
model = IcarmModel(model="logistic", positive="Yes")
model.fit(X_tr, y_tr)
print(model)
# Performance
model.metrics(X_te, y_te)
# Global explanation
ex = model.explain()
ex.plot()
# SHAP values
shap = model.shap(X_te, n_samples=50)
shap.plot()
# ALE profile
ale = model.ale(X_te, feature="num_prior_visits")
ale.plot()
# Fairness audit
f = model.fairness(X_te, y_te, protected="gender")
f.plot(metric="dp_ratio", ref_line=0.8)
f.summary()
# Accountability
model.scorecard(analyst="O. O. Awe",
project="Hospital Readmission Study")
trail = model.audit(analyst="O. O. Awe")
Functional API (mirrors R)
from icarm import (
icarm_fit, icarm_split, icarm_metrics,
icarm_explain, icarm_shap, icarm_ale,
icarm_fairness, icarm_equity_summary,
icarm_calibrate, icarm_thresholds,
icarm_drift, icarm_cv, icarm_compare,
icarm_audit, icarm_scorecard,
)
m = icarm_fit(X_tr, y_tr, model="logistic", positive="Yes")
icarm_metrics(y_te, m.predict(X_te),
y_prob=m.predict(X_te, type="prob")["Yes"].values,
positive="Yes")
Supported models (18 total)
| Family | Model code |
|---|---|
| Interpretable | cart, logistic, logistic_l1, linear, ridge, elastic_net, gam, multinomial, naive_bayes, lda, knn |
| Extended | random_forest, xgboost, svm, lightgbm, bagging, nnet_reg |
| Custom | custom |
R package
The companion R package is available on CRAN:
install.packages("icarm")
Author
Olushina Olawale Awe Alexander von Humboldt Visiting Professor, PH Ludwigsburg, Germany ORCID: 0000-0002-0442-4519
Citation
@software{Awe_icarm_python_2026,
author = {Awe, Olushina Olawale},
title = {{icarm}: Interpretable, Contextual-Accountable and
Responsible Machine Learning for Python},
year = {2026},
url = {https://github.com/Olawaleawe/icarm-python},
version = {0.1.0}
}
License
MIT
Metadata
Release files for icarm 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| icarm-0.1.0.tar.gz | 28.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| icarm-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.7 kB
Release files / icarm-0.1.0.tar.gz
| Download URL | icarm-0.1.0.tar.gz |
|---|---|
| Size | 28.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
916fb3d286fb9d36e899a9745ad9f8eb16aa623fdd3dcd9603b596ddbfa2e493
|
|
BLAKE2b-256 checksum How to use checksums |
f882fe98a43155bd597187eecd7bdccb43128c41ba0754d21b84fbec45defce1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|
Release files / icarm-0.1.0-py3-none-any.whl
| Download URL | icarm-0.1.0-py3-none-any.whl |
|---|---|
| Size | 31.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
175904adc6385bb9cfc8ed9f8fc5144ee04b6026eae02b3c34a7ff8f69edc171
|
|
BLAKE2b-256 checksum How to use checksums |
a5190656e5a76053ece803cfd6072bf9a18cd29bfbb8a18fb1f14eb1ded861ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.7
|