Visualizing and Predicting Classes with Scatterplot and KNN
KNN Visualization Workflow
1
Two Numeric Features
Pick two for scatter plot axes.
2
Color by Class
scatter(x, y, c=labels) — color points by their class.
3
Train KNN
KNeighborsClassifier(n_neighbors=5).fit(X, y).
4
Predict Grid
Predict over a grid of points to draw decision boundaries.
Master Machine Learning at Noble Desktop
Noble Desktop's Python Machine Learning Bootcamp covers scikit-learn, Keras, neural networks, and applied ML.
This lesson is a preview from our Data Science & AI Certificate Online (includes software) and Python Certification Online (includes software & exam). Enroll in a course for detailed lessons, live instructor support, and project-based training.
Visualize and classify a new data point using the KNN model. Watch this tutorial to learn the key concepts and techniques.