This project implements a K-Nearest Neighbors (KNN) classifier to predict user behavior from the Social Network Ads dataset. It includes data visualization, feature scaling, training/testing split, and decision boundary visualization using mlxtend.
- Name:
Social_Network_Ads.csv - Features Used:
- Age
- Estimated Salary
- Target: Purchased (0 = No, 1 = Yes)
- KNN classifier using
scikit-learn - Feature scaling with
StandardScaler - Visualization of decision boundaries
- Accuracy evaluation on test set
- Test Accuracy: ~0.90 (with
k=3) - You can experiment with other
kvalues to observe accuracy changes
- Scatter plot of raw data (
AgevsEstimatedSalary) - Decision region plot to visualize KNN classification boundaries
- Clone the repository:
git clone https://github.com/shahzadmustafa15/KNNClassifier.git cd KNNClassifier