ModelDoctor
Diagnose your machine learning models like a senior ML engineer.
What is ModelDoctor?
ModelDoctor is an automated clinical diagnostics engine for machine learning models. It runs a comprehensive suite of rigorous checks against your trained model to identify hidden problems, explain why they occur, and prescribe actionable fixes before deployment.
Why does it exist?
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 bridges this gap by evaluating models holistically. Instead of leaving you to interpret raw numbers, ModelDoctor explains what issues exist, why they are problematic, and exactly how to fix them.
How does it work?
- Contextualization: ModelDoctor wraps your scikit-learn model, training data, and test data into an
EvaluationContext. - Diagnosis: Specialized
Doctors(likeLeakageDoctorandOverfittingDoctor) independently analyze the context. - Evidence Synthesis: The
EvidenceEnginecollects findings, which are scored by theConfidenceEngineandRiskEngine. - Prescription: The
PrescriptionEnginegenerates actionable recommendations. - Reporting: Results are compiled into an interactive HTML dashboard, JSON, or Markdown report.
How do I get started?
Install the library:
Run a diagnosis:
import modeldoctor as md
# diagnose() takes any scikit-learn compatible estimator
report = md.diagnose(model, X_train, y_train, X_test, y_test)
# Open the interactive HTML dashboard
report.dashboard()
Documentation Navigation
- Getting Started
- Installation
- Quick Start
- Dashboard
- CLI Reference
- Core Concepts
- Health Score
- Diagnostic Doctors
- Evaluation Context
- Findings
- Prescriptions
- Reports
- User Guides
- Classification
- Regression
- Model Comparison
- Explainability
- Calibration
- MLflow Integration
- Plugins & Custom Doctors
- Dashboard Customization
- Examples
- Basic Usage
- Advanced Usage
- Reference
- API Reference
- Roadmap
- Support
- FAQ
- Troubleshooting
- Contributing
- Changelog
- Validation Lab