Skip to main content
🔒 Preview mode. The first 15 Foundations lessons are free; this one is Pro. Start a 7-day trial to unlock the editor, AI hints and the rest of the curriculum. Card required, cancel any time in Dashboard.
Start 7-day trial →
⚡
← Courses
›
Data Science Applied
›
Module 4 · Causal Inference & A/B Testing
›
Fix the leakage: scale-before-split
quiz
59 / 104
🇺🇸
EN
▼
↗
Share
⋯
More
+125 XP
📋
Task
📖
Theory
🤖
AI Help
Task
📝 **Question:** Which of these correctly avoids the leakage? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
🎯 Quiz
Question
📝 **Question:** Which of these correctly avoids the leakage? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
A
`scaler.fit_transform(X)` first to learn the full-distribution statistics, THEN split — saves one pass and helps the scaler converge
B
Split first, wrap scaler + classifier in `Pipeline`, call `pipe.fit(X_train, y_train)` — the scaler fits on train and reuses stats on test
C
Skip scaling entirely; `LogisticRegression(solver='lbfgs')` is invariant to the input scale and trains fine on raw columns
D
Call `StandardScaler.fit_transform` per row inside a `df.apply(...)` so each example normalizes against its own observed values
Submit answer
💬 Discussion
Be the first to ask a question or share a tip.
Sign in
to join the discussion. Reading is free.
Loading discussion…