Skip to content

Implementation of the K-Nearest Neighbors (K-NN) algorithm for classifying users based on age and estimated salary. Includes data preprocessing, model training, evaluation, and visualization of decision boundaries.

Notifications You must be signed in to change notification settings

EbadShabbir/K-Nearest-Neighbour-social-media-ads-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

K-Nearest Neighbors (K-NN) Classification

This repository contains an implementation of the K-Nearest Neighbors (K-NN) algorithm for classifying users based on their age and estimated salary. The dataset used is the "Social Network Ads" dataset.

Overview

The K-NN algorithm is a simple, non-parametric classification algorithm that works by finding the majority class among a query point's nearest neighbors. In this project, we:

  • Load and preprocess the dataset
  • Train a K-NN model
  • Evaluate the model using a confusion matrix
  • Visualize decision boundaries for both the training and test datasets

Prerequisites

Ensure you have the following libraries installed:

```bash
pip install numpy pandas matplotlib scikit-learn

Cloning the repository

git clone https:/EbadShabbir/github.com//knn-classification.git
cd knn-classification

About

Implementation of the K-Nearest Neighbors (K-NN) algorithm for classifying users based on age and estimated salary. Includes data preprocessing, model training, evaluation, and visualization of decision boundaries.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published