diagnost
A model diagnostics library for data scientists.
Performance, calibration, drift detection, and dataset health checks, all in a few lines of Python.
Why diagnost?
Most ML libraries help you build models. diagnost helps you trust them.
After training, the real questions start:
- Is my model actually reliable, or just accurate on average?
- Does it perform equally across different groups?
- Are its confidence scores meaningful?
- Has my data drifted since I trained it?
diagnost answers all of these, cleanly, quickly, and in plain English.
Installation
pip install diagnost
Quickstart
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_iris
import diagnost
X, y = load_iris(return_X_y=True, as_frame=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)
report = diagnost.evaluate(model, X_test, y_test, task="classification")
report.summary()
Features
1. Model Evaluation
Evaluate classification, regression, and clustering models with one call.
# Classification
report = diagnost.evaluate(model, X_test, y_test, task="classification")
# Regression
report = diagnost.evaluate(model, X_test, y_test, task="regression")
# Clustering
report = diagnost.evaluate(model, X_test, task="clustering")
Subgroup / fairness analysis — check performance across sensitive groups:
report = diagnost.evaluate(
model, X_test, y_test,
task="classification",
sensitive_features=["gender", "age_group"]
)
report.summary()
2. Model Comparison
Compare multiple models side by side with a winner declared automatically.
from diagnost.compare import compare
report = compare(
models={"Random Forest": rf, "Logistic Regression": lr},
X=X_test,
y=y_test,
task="classification"
)
df = report.to_dataframe() # returns a pandas DataFrame
3. Calibration Analysis
Check whether your model's predicted probabilities are actually reliable.
from diagnost.calibration import check_calibration
check_calibration(model, X_test, y_test)
Output includes:
- Expected Calibration Error (ECE) per class
- Brier score per class
- Plain-English verdict ("Well calibrated", "Poorly calibrated")
- Reliability diagram
4. Drift Detection
Detect whether your input data has shifted since training.
from diagnost.drift import check_drift
check_drift(X_train, X_new)
- Kolmogorov-Smirnov test for numeric features
- Chi-Square test for categorical features
- Per-feature drift verdict with p-values
- Distribution plots for drifted features
5. Dataset Diagnostics
Inspect your dataset before modelling.
results = diagnost.inspect_dataset(df)
Checks for:
- Missing values
- Highly correlated features (r > 0.85)
- Outliers (IQR method)
- Feature distributions (visual)
Saving Reports
report = diagnost.evaluate(model, X_test, y_test, task="classification")
report.save("report.json") # exports as JSON
Supported Model Types
| Task | Supported Frameworks |
|---|---|
| Classification | scikit-learn, XGBoost, LightGBM, CatBoost |
| Regression | scikit-learn, XGBoost, LightGBM, CatBoost |
| Clustering | scikit-learn |
Any model with a .predict() method will work.
Requirements
- Python >= 3.9
- numpy, pandas, scipy, matplotlib, scikit-learn
Contributing
Contributions are welcome. To get started:
git clone https://github.com/Eklavya20/diagnost.git
cd diagnost
python -m venv venv
venv\Scripts\activate # Windows
pip install -e ".[dev]"
pytest tests/ -v
Please open an issue before submitting a large pull request.
License
MIT License — free to use, modify, and distribute.
See LICENSE for details.
Author
Eklavya Jumnani
MSc Data Science, FAU Erlangen-Nürnberg
GitHub · LinkedIn
Release files for diagnost 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| diagnost-0.1.2.tar.gz | 15.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| diagnost-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.4 kB
Release files / diagnost-0.1.2.tar.gz
| Download URL | diagnost-0.1.2.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
023cf644ef140bb61d8fdb4c0bf28c169792ce94f87234efefa5efd0872653b5
|
|
BLAKE2b-256 checksum How to use checksums |
69807e3e3485ed34d6f5bcb87f6a045c16dbc3af2d5e192bb4bb560c32f6e208
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency logRelease files / diagnost-0.1.2-py3-none-any.whl
| Download URL | diagnost-0.1.2-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dfb8b1076c5f7fed6147efcce5380efb165555f2d558b29f0141471f2672a50b
|
|
BLAKE2b-256 checksum How to use checksums |
ae973460bdce2b88d42edc0a58199ccb1e939395f3b95ed74b5b5b71dcb79ed7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 24, 2026.
Transparency log