Imagine a toy factory with a conveyor belt. Every new toy design (code), new batch of plastic (data), and finished toy (model) rides the belt. At each checkpoint a robot inspector checks: Is the design safe? Is the plastic clean? Does the toy actually work better than the one in the shops? Only toys that pass every checkpoint get boxed and sent to stores. And a special sensor watches the shops — if kids stop liking the toy, it rings a bell that starts building a new one automatically. The belt + inspectors + bell together are the ML CI/CD pipeline.
What three things change independently in an ML system (unlike normal software)?
Code, data, and model.
What does CT (Continuous Training) add beyond CI/CD?
Automatic retraining triggered by new data or performance drift, to fight model decay.
Why must the promotion gate use the same held-out test set for old and new models?
So the score difference reflects model skill, not differences in the evaluation data.
Why require a margin δ instead of promoting on any improvement?
Metrics are noisy; a small gain can be random luck. δ ensures the improvement exceeds the noise floor.
Give the rule-of-thumb formula for a safe promotion margin on accuracy.
δ≳2p(1−p)/n (≈ two standard errors).
What is training/serving skew and how does CI/CD prevent it?
When training and production environments differ, giving different behaviour; prevented by training inside the same containerized pipeline used in prod.
Dekho, normal software me sirf code change hota hai. Par ML me teen cheezein alag-alag change hoti hain: code, data, aur model. Isliye ML ka CI/CD ek automatic assembly line jaisa hai — jaise hi koi change aaye (naya git push, fresh data, ya drift alarm), pipeline usko test karti hui production tak le jaati hai. Har stage pe ek "gate" hota hai jahan check hota hai — code sahi hai? data ka schema theek hai? model production wale se behtar hai? Agar koi bhi check fail, toh pipeline waheen ruk jaati hai, aur ganda model users tak nahi pahunchta.
Sabse important ML-specific cheez hai CT (Continuous Training). Kyunki model apne aap "sadta" (decay) hai — duniya badalti hai, users ka behaviour badalta hai, isliye purana model galat hone lagta hai. Isko drift kehte hain (PSI > 0.2 ek common signal hai). Jab drift detect hota hai, CT trigger hota hai aur model automatically retrain hota hai. Yeh feedback loop hi pipeline ko "zinda" rakhti hai.
Ek key idea yaad rakho: model deploy tabhi karo jab naya model production wale se sirf thoda nahi, balki noise se zyada behtar ho. Formula: δ≳2p(1−p)/n. Iska matlab — agar test data bada hai (n zyada), toh chhote improvement pe bhi bharosa kar sakte ho; agar test data chhota hai, toh bada improvement chahiye. Isse random luck wale "improvement" pe model baar-baar change nahi hota.
Aur ek galti se bacho: "tests pass ho gaye matlab model achha hai" — yeh galat hai. Tests sirf code bugs pakadte hain, statistical failure (accurate code par bekaar model) nahi. Isliye ek alag evaluation gate zaroori hai. Saath hi, model laptop pe nahi, wahi Docker container ke andar train karo jo production me chalega — warna training/serving skew ho jayega.