CLI
ModelDoctor includes a command-line interface (CLI) for running diagnostics without writing custom Python scripts. This is especially useful for integrating ModelDoctor into CI/CD pipelines.
Usage
Commands
diagnose
Runs the diagnostic pipeline against a serialized model and dataset.
Arguments & Flags:
--model(Required): Path to the serialized scikit-learn model (.pkl,.joblib).--data(Required): Path to the CSV file containing the features and target.--target(Required): The column name representing the target variable.--out: Path to save the resulting report. The format is inferred from the extension (.json,.html,.md).--config: Path to a customconfig.yamlfile to override default thresholds.
serve
Starts a lightweight local web server to host and view previously generated HTML dashboards.
Arguments & Flags:
--dir: The directory containing ModelDoctor.htmlreports.--port: The port to bind the server to (default: 8080).
Exit Codes
The diagnose command returns exit codes based on the diagnostic severity, making it ideal for CI/CD gating:
0: Success. The model is healthy or only containsINFOlevel findings.1: Execution error (e.g., file not found, unpickling error).2: Warning. The model generatedWARNINGlevel findings.3: Critical. The model generatedCRITICALlevel findings.