Machine Learning

KNN Algorithm for Classification and Regression: Hands-On With Scikit- Learn

Google Colab and Python

Carla Martins
Towards AI
Published in
8 min readFeb 22, 2022

--

Table of Contents:A — KNN for classification
1. Import Libraries
2. Build a dataset
3. Explore Dataset
4. Setting variables for ML
5. Split data into train and test
6. Building the model
7. Finding best k value
8. Model Complexity
9. Plotting decision boundaries
B — KNN for regression
1. Import Libraries
...
6. Building the model
7. Finding best k value
8

--

--

Compulsive learner. Passionate about technology. Speaks C, R, Python, SQL, Haskell, Java and LaTeX. Interested in creating solutions.