5.3.13 · HinglishMLOps & Deployment

Data drift and concept drift detection

1,910 words9 min readRead in English

5.3.13 · AI-ML › MLOps & Deployment


Drift exist hi KYU karta hai?

Hum joint distribution ko chain rule se split kar sakte hain:

Yeh factorization poori conceptual key hai — neeche jo bhi hai woh isi sawaal se nikalti hai ki kaun sa factor badla.

Figure — Data drift and concept drift detection

Hum actually KIYA measure kar rahe hain?

Tum directly kabhi observe nahi karte — sirf samples. Toh detection = ek reference window (training/recent-good) ko ek current window (live) se compare karna aur poochna "kya yeh dono samples ek hi distribution se hain?"

1. Data drift — input distributions compare karo

Hum reference feature distribution ko current se compare karte hain.

2. Concept drift — tumhe error monitor karna hoga


Worked example: PSI compute karna


Common mistakes (steel-manned)


Active recall

Recall Feynman: ek 12-year-old ko explain karo

Imagine karo tumne ball pakadna seekha apne dost ko throw karte dekhke. Data drift tab hota hai jab ek alag dost throw karne lagta hai — balls naye angles se aate hain (inputs badal gaye), lekin ball abhi bhi usi tarah udhti hai, toh tum phir bhi pakad sakte ho. Concept drift zyada spooky hai: physics ke rules khud change ho jaate hain — wahi throw ab alag curve karti hai, toh tumhari purani pakadne ki habit fail ho jaati hai. Drift detectors ek coach ki tarah hain jo constantly poochta hai "kya yeh throws abhi bhi waise hi hain jaise tumne practice kiye?" (data drift) aur "kya tum abhi bhi unhe pakad rahe ho?" (concept drift). Agar kisi bhi sawaal ka jawab "nahi" hai, toh phir se practice karne ka time hai.


Connections


#flashcards/ai-ml

Chain rule factorization jo drift define karne ke liye use hoti hai
; data drift badalta hai, concept drift badalta hai.
Data drift (covariate shift) ki definition
badalta hai jabki fixed rehta hai — inputs shift hote hain lekin input→output rule intact rehta hai.
Concept drift ki definition
badalta hai — same input ab different labels pe map karta hai; underlying rule badal gaya.
PSI formula
binned proportions pe; symmetrized KL.
PSI hamesha ≥ 0 kyun hota hai
, toh har term non-negative hai (equivalently yeh ek symmetrized KL divergence hai).
PSI thresholds
<0.1 koi drift nahi, 0.1–0.25 moderate, >0.25 significant.
KL divergence formula
, Jensen se hamesha ≥0, =0 tabhi jab P=Q.
KS statistic
, empirical CDFs ke beech maximum vertical gap.
Categorical feature drift ke liye test
Chi-square: observed vs reference-expected counts compare karta hai.
DDM warning/drift rule
warning pe, drift pe, jahaan .
Concept drift ko labels kyun chahiye
Yeh mein change hai; rule toot-ta tabhi dikh sakta hai jab predictions ko true se compare karo (ya proxies jaise confidence/output ratios se).
"Badi current window" detection kyun hurt karti hai
Badi window change point ke upar average kar leti hai, drift signal ko delay aur dilute karti hai; adaptive/sliding windows (ADWIN) use karo.

Concept Map

deploy ke baad toot jaata hai

chain rule se split

P of X badalta hai

P of Y given X badalta hai

inputs alag, rule intact

mapping toot gayi

compare karke detect karo

per-bin log-ratio metric

equals symmetrized

threshold above 0.25

protect karta hai

Stationary assumption P of X,Y

Drift exist karta hai

P of X,Y = P of Y given X times P of X

Data drift / covariate shift

Concept drift

Fix: reweight / monitor

Fix: naye labels se retrain

Reference vs current window

Population Stability Index

KL divergence

Significant drift alarm

Business metrics