https://github.com/tasninanika/coded_data_prediction-knn
K-Nearest Neighbors (KNN) is a supervised machine learning algorithm
https://github.com/tasninanika/coded_data_prediction-knn
knn pandas python3 scikit-learn
Last synced: 3 months ago
JSON representation
K-Nearest Neighbors (KNN) is a supervised machine learning algorithm
- Host: GitHub
- URL: https://github.com/tasninanika/coded_data_prediction-knn
- Owner: tasninanika
- Created: 2025-06-27T16:14:16.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-28T09:12:04.000Z (12 months ago)
- Last Synced: 2025-08-16T11:22:57.455Z (10 months ago)
- Topics: knn, pandas, python3, scikit-learn
- Language: Jupyter Notebook
- Homepage:
- Size: 36.1 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🤖 Coded Data Prediction using K-Nearest Neighbors (KNN) Classifier
This project demonstrates how the **K-Nearest Neighbors (KNN)** algorithm can be used to build a simple and effective machine learning classifier. KNN is an easy-to-understand and powerful algorithm used for **classification** and **regression** problems.
---
## 📌 What is KNN?
**K-Nearest Neighbors (KNN)** is a **supervised machine learning** algorithm that predicts the output class of a new data point by looking at the **'K' closest data points** in the training dataset. It works on the principle that similar data points are near each other.
For classification tasks:
- It checks the **K nearest neighbors** of a data point.
- Takes a **majority vote** from the neighbors' classes.
- Assigns the most common class as the prediction.
---
## 📈 Key Steps in This Project
1. Import necessary libraries (`sklearn`, `pandas`, etc.)
2. Load and explore the dataset
3. Split data into training and testing sets
4. Train the KNN model using `KNeighborsClassifier`
5. Predict and evaluate accuracy using test data