Target leakage in feature engineering
An AI generated this fraud-model feature step. The model hits 0.99 AUC on holdout and the team is thrilled. As the reviewer, explain why you'd block it.
Implement
prior_account_mean_amount(account_ids: list[str], timestamps: list[str], amounts: list[float]) → list[float]Examples
in
[["a","a","a"],["2026-01-01","2026-01-02","2026-01-03"],[10,20,60]]out[-1,10,15]in
[["a","b","a","b"],["2026-01-03","2026-01-01","2026-01-01","2026-01-02"],[30,5,10,7]]out[10,-1,-1,5]in
[["a","a"],["2026-01-01","2026-01-01"],[4,8]]out[-1,4]What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 20 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.