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 1 · Python for Data · Recap
›
scikit-learn intro: a 5-line model
quiz
24 / 104
🇺🇸
EN
▼
↗
Share
⋯
More
+100 XP
📋
Task
📖
Theory
🤖
AI Help
Task
📝 **Question:** Why split data into train/test sets before evaluation? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
🎯 Quiz
Question
📝 **Question:** Why split data into train/test sets before evaluation? 📋 Pick the right answer. 💡 **Hint:** Re-read the theory above if unsure.
A
Training on fewer rows speeds up the fit step — splitting off 20% as a held-out set means the optimiser converges in roughly 80% of the wall-clock time on every iteration
B
Evaluating on training data gives an optimistic, fake metric — the model has 'seen' those rows. Holding out a test set measures real-world generalization
C
sklearn requires a train/test split before `.fit()` — calling `LogisticRegression().fit(X, y)` on the full frame raises a ValueError unless a holdout has been carved out first
D
Splitting saves RAM because the fitted model only stores the coefficients for the seen rows and the test partition lives on disk until the prediction step actually needs it
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…