An open API service indexing awesome lists of open source software.

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

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