$ ⌘K
// playbooks / global-supply-chain-risk · ml_risk_classification

ML Risk Classification & Explainability

step_count: 8· runtime: —

Machine learning pipeline for supply chain disruption prediction: train ensemble models (RF, XGBoost), evaluate with proper cross-validation, generate SHAP explanations, and test anomaly detection. Includes causal forest for heterogeneous intervention effects.

// pipeline
8 steps· DAG
01

ML Data Quality Gate

action data_quality_gateon fail: abort
config (5 keys)
{
  "constructs": [
    "supply_chain_disruption_binary",
    "supplier_financial_health",
    "lead_time_variability",
    "geographic_concentration_risk",
    "network_betweenness_centrality"
  ],
  "max_missing_pct": 0.1,
  "min_observations": 200,
  "min_positive_class_pct": 0.05,
  "require_balanced_classes": false
}
02

Feature Engineering & Selection

action analyze
config (4 keys)
{
  "create_interaction_terms": true,
  "create_lag_features": true,
  "handle_imbalance": "smote",
  "lag_periods": [
    1,
    3,
    6
  ]
}
03

Random Forest — Disruption Prediction

engine random_forestfeature_engineering
config (5 keys)
{
  "cv_folds": 5,
  "n_estimators": 500,
  "outcome": "supply_chain_disruption_binary",
  "predictors": [
    "supplier_financial_health",
    "lead_time_variability",
    "geographic_concentration_risk",
    "network_betweenness_centrality",
    "geopolitical_risk_index",
    "climate_exposure_score",
    "tier_depth",
    "inventory_buffer_ratio"
  ],
  "scoring": "roc_auc"
}
expected results (1 key)
{
  "auc": {
    "min_value": 0.7
  }
}
04

XGBoost — Gradient Boosting Benchmark

engine gradient_boostingfeature_engineering
config (5 keys)
{
  "cv_folds": 5,
  "early_stopping_rounds": 50,
  "outcome": "supply_chain_disruption_binary",
  "predictors": [
    "supplier_financial_health",
    "lead_time_variability",
    "geographic_concentration_risk",
    "network_betweenness_centrality",
    "geopolitical_risk_index",
    "climate_exposure_score",
    "tier_depth",
    "inventory_buffer_ratio"
  ],
  "scoring": "roc_auc"
}
05

SHAP Feature Importance & Explanations

engine shap_explainerxgboost_model
config (3 keys)
{
  "model_source": "xgboost_model",
  "plot_types": [
    "summary",
    "dependence",
    "force"
  ],
  "top_features": 10
}
06

Isolation Forest — Anomaly Detection (Unsupervised)

engine isolation_forest
config (3 keys)
{
  "contamination": 0.05,
  "features": [
    "lead_time_variability",
    "supplier_financial_health",
    "trade_flow_volume",
    "port_congestion_index"
  ],
  "n_estimators": 200
}
07

Causal Forest — Heterogeneous Treatment Effects

engine causal_forestrandom_forest_model
config (4 keys)
{
  "covariates": [
    "geographic_concentration_risk",
    "tier_depth",
    "supplier_financial_health"
  ],
  "n_estimators": 500,
  "outcome": "supply_chain_disruption_binary",
  "treatment": "supplier_diversification"
}
// from pax
Global Supply Chain Risk
// engines
engine.causal_forestengine.gradient_boostingengine.isolation_forestengine.shap_explainerengine.random_forest
// note
step bodies extracted from the .pax archive at build time. download the parent pax for the full yaml.
[ download global-supply-chain-risk.pax.tar.gz ]