3 · A peek at where this is heading
Two lines of Python you'll write over and over in ML — and the picture they paint.
One idea, one try. At your own pace.
LEARN BY DOINGPut your intuition to work3 steps
3 · A peek at where this is heading
Use the lesson’s examples and explanation to check your idea.
Personal reflection. Nothing is sent to an AI service.Every supervised ML pipeline starts by splitting data into a train set and a test set.
Without this:
Without a held-out test set, you can't tell whether your model learned anything or just memorized.
Take a deep breath. We're three lessons in and you're about to see the single most important pattern in supervised ML: the train/test split. The scene below shows what happens when you call one line of scikit-learn.
In Python that's literally two lines:
Python (in browser)
80/20 split with a fixed random seed so the result is reproducible.
Python runs entirely in your browser via Pyodide (~6 MB on first Run, cached after).
Why split? It's about generalization — the math is gradient descent on unseen data.
Don't worry if scikit-learn looks intimidating right now. By the end of Track 5 (Classical Supervised ML) you'll write this in your sleep.
- Train/test split is the bedrock of every honest ML experiment.
- A fixed random seed makes results reproducible — a habit you should keep.
Literally every supervised learning notebook on the planet starts with `train_test_split(...)`.
If you remove it: You can't trust a model evaluated on the data it trained on — the metric tells you nothing about real-world performance.