Skip to content

Examples

Six notebooks, each executed and committed with outputs. None needs external data or credentials.

Notebook Task Domain Model
01 Binary classification binary credit scoring GradientBoostingClassifier
02 Multiclass and ordinal multiclass, ordinal underwriting RandomForestClassifier
03 Regression regression premium, severity, frequency GradientBoostingRegressor
04 PyTorch and friends binary fraud PyTorch, Keras-shaped, remote
05 Boosters and the CLI binary fraud XGBoost, --model-loader
06 Reports and plots all three credit, pricing, underwriting LogisticRegression, plain functions

Start with 01. It covers the core machinery — contexts, checks, reports, verdicts, configuration, custom checks, plugins, validation and the CLI. The others assume it and focus on what their task or framework changes.

06 is the other half — the nine charts, why each one is not a number, and the self-contained HTML report a reviewer signs.

Running them

pip install "bdp-model-gate[structured]" jupyter
jupyter lab examples/

01–03 need nothing more. 04 needs torch; 05 needs xgboost (and brew install libomp on macOS, which XGBoost requires there regardless); 06 needs the [plots] extra.

Why PyTorch and XGBoost are in separate notebooks

On macOS the two link different OpenMP runtimes and segfault in the same process — a hard crash, not an exception. A single notebook covering both would die partway through for many readers.

Source lives in examples/, and examples/run_all.sh re-executes them all and fails on the first error.