Draw the boundary
A model "learns" a decision boundary — the dividing line it draws through
space to tell one class from another. Some boundaries are straight. Some have to
bend.
Here's the challenge: two interleaving half-moons. No straight line can cleanly
separate them. A LogisticRegression would try to draw one and fail. You need a
model that can curve around the data.
Your task
- Pick a model that can bend (blank 1). A good first choice is
KNeighborsClassifier(n_neighbors=15) — it decides each point's class by
looking at its nearest neighbours, so its boundary follows the shape of the data.
- Train it on the training split (blanks 2 and 3).
When you hit Run, the lab draws the decision boundary on top of the data. If your
model learned the shape, you'll see the boundary hug the curve of the moons.
You pass when
Your model scores ≥ 85% accuracy on data it has never seen.
Tip: the scatter colours are the true labels. The shaded background is what your
model predicts for every point in the plane. You want those to agree.