JP
JPMorgan Chase AI

VP Applied Quant RAG & Low-Latency Risk Systems • ₹42 LPA – ₹90 LPA+ (VP / ED AI)

Quant ML Risk & Leakage DefenseCore Systems: No-AI

Codebase 2: Classic ML Pipeline & Train-Serving Skew Audit

Audit a real payment fraud ML training pipeline and live serving API. Offline metrics claim 0.99+ accuracy, yet live production fails silently because of target leakage, time-series shuffle leakage, preprocessing fit over train+test combined, stale serving constants, and unguarded NaN crashes.

System Design Perspective

Financial ML Parity & Chronological Validation

Before You Start (JPMorgan Chase AI)

Run `python test_ml_pipeline.py` in Codebase 2 to fix target leakage, temporal splitting, and unguarded NaN scoring before production deployment.

Download & Run LocallyDownload .zip
Runtime: Python 3.9+ (Pure stdlib — zero pip install required)
unzip classic-ml-pipeline.zip
cd classic-ml-pipeline
python test_ml_pipeline.py
python serving_api.py
# Open http://localhost:8150 to compare offline training vs live checkout scoring!
# BUG 1 (Target Leakage): post-event column unknown at checkout!
LEAKY_FEATURES = ["amount", "velocity_1h", "chargeback_settled_30d"]

# BUG 2 (Temporal Split Leakage): shuffles time-series fraud events!
random.Random(42).shuffle(shuffled)

# BUG 3 (Preprocessing Leakage): fits mean/std on train + test TOGETHER!
all_amounts = [r["amount"] for r in shuffled]
mean_amt = sum(all_amounts) / len(all_amounts)