leakage가 뭐야
Target leakage는 prediction 시점에 존재하지 않을 정보가 feature에 들어 있는 거야. ML 모델이 노트북에선 멋지고 production에선 실망스러운 가장 흔한 원인이야. leakage는 아름다운 validation 숫자와 deploy 못 할 모델을 동시에 만들어.
세 종류
- Time leakage — 미래 aggregate 사용 (전체 dataset에 걸쳐 계산된 last-30-days revenue).
- Post-event leakage — outcome 후에만 존재하는 column (cancel reason, refund amount, 그 이슈 자체에 대한 support call).
- Preprocessing leakage — split 전에 전체 dataset에 scaler / imputer / encoder를 fit. train statistics가 이제 test set을 안다.
방어
feature를 pipeline 안에서 빌드해, pipeline 전이 아니라. 먼저 split 하고 transformer는 training만 보고 fit. 한 column 빼면 validation score가 비현실적으로 떨어지는 column은 audit해. feature 하나가 모델을 다 캐리하면, 증명 전까지는 leakage야.