A production-grade ML model diagnostic framework — behaves like a senior ML engineer reviewing your model
Project description
Why ModelDoctor?
Traditional machine learning evaluation focuses almost entirely on aggregate metrics like accuracy, precision, and recall. While these numbers indicate how well a model performs on a specific dataset, they rarely explain why it behaves that way or whether the model will actually survive in a production environment.
ModelDoctor evaluates models holistically. It runs a comprehensive suite of diagnostic checks to identify hidden problems—from subtle data leakage and overfitting to calibration errors and inference latency.
Instead of leaving you to interpret raw numbers, ModelDoctor explains what issues exist, why they are problematic, and exactly how to fix them before deployment.
Quick Example
import modeldoctor as md
report = md.diagnose(
model,
X_train,
y_train,
X_test,
y_test,
)
report.show()
Installation
Install the core library:
pip install modeldoctor
You can optionally install extensions for specific features:
pip install modeldoctor[dashboard]
pip install modeldoctor[shap]
pip install modeldoctor[all]
Features
Diagnostics
- Overfitting
- Data Leakage
- Calibration
- Prediction Quality
- Feature Analysis
- Data Quality
- Generalization
- Production Readiness
Reporting
- HTML Dashboard
- Markdown
- JSON
- CLI
- MLflow
Explainability
- SHAP
- Feature Importance
- Evidence Engine
- Confidence Engine
- Prescription Engine
Example Output
Overall Health: 82/100 (Needs Review)
Diagnosis: Potential Data Leakage Detected (Critical)
The top feature customer_id accounts for 98% of the total feature importance and has a nearly perfect correlation (0.99) with the target variable.
Prescription: Remove customer_id from the training dataset.
Recommendation: Retrain the model and ensure no future information or unique identifiers are included in the feature set.
Architecture
The evaluation process begins by wrapping your model and dataset into an EvaluationContext, computing metrics lazily only as needed. Specialized Doctors then analyze this context across different dimensions, extracting concrete Evidence. The Confidence and Risk engines synthesize this evidence into prioritized Prescriptions, ultimately rendering them into a standardized Report.
Validation
ModelDoctor is continuously verified against the Validation Laboratory, an independent framework designed to stress-test the diagnostic engine across real-world edge cases.
| Metric | Result |
|---|---|
| Validation Scenarios | 54 |
| Diagnostic Accuracy | 98.1% |
| Supported Models | Scikit-learn |
| Validation Framework | Included |
Dashboard
The HTML dashboard provides an interactive interface to explore your model's health score, drill down into specific diagnostic charts, and review prioritized recommendations. The report is fully self-contained, searchable, and easy to export and share with stakeholders.
Documentation
Examples
classification.py— Diagnose a standard binary classifier.regression.py— Evaluate a regressor's prediction quality.dashboard.py— Generate and serve an interactive HTML dashboard.html_report.py— Export static reports for CI/CD pipelines.custom_doctor.py— Build and register a custom diagnostic rule.
Roadmap
- Core diagnostics
- Validation laboratory
- Dashboard
- CLI
- MLflow integration
- Regression support enhancements
Future
- PyTorch support
- TensorFlow support
- CatBoost enhancements
Contributing
Contributions are welcome. Please refer to our CONTRIBUTING.md for details.
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a Pull Request
Citation
If you use ModelDoctor in academic research, please cite it:
@software{modeldoctor,
title = {ModelDoctor: Clinical Diagnostics for Machine Learning Models},
author = {ModelDoctor Contributors},
year = {2026},
url = {https://github.com/modeldoctor/modeldoctor}
}
Security
Please report security vulnerabilities according to the guidelines in SECURITY.md.
Do not report security vulnerabilities through public GitHub Issues.
License
This project is licensed under the MIT License.
Built by the ModelDoctor community.
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 modeldoctor-0.1.0.tar.gz.
File metadata
- Download URL: modeldoctor-0.1.0.tar.gz
- Upload date:
- Size: 24.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf2f8f85907c4db481f5b1c963554e86082e4c721ff2d286f770f5b2a3f5d097
|
|
| MD5 |
47031a61c5ef87962743426951dec66f
|
|
| BLAKE2b-256 |
ae5ccafb9066a403b78879df915462d51bd6f853ebb0e7df6499d5532fa43b4e
|
File details
Details for the file modeldoctor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: modeldoctor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 93.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 |
730fa10d69ec1b35aacf0ad4e0b22ac100b8f6ccad47ddbc91646ada9fcd73a1
|
|
| MD5 |
1c3ec7dd3695a311c34e2cd908e47d12
|
|
| BLAKE2b-256 |
0a3a544ab74d1b561de5a8101bfc36f8e32b3ee9fdb41dfa0d86b64e8da420a1
|