Skip to content

KNN is a simple, supervised machine learning algorithm that can be used to solve both classification and regression problems. This was built from scratch.

Notifications You must be signed in to change notification settings

foxster14/k_nearest_neighbor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K Nearest Neighbor

The k-nearest neighbors (KNN) algorithm is a simple, supervised machine learning algorithm that can be used to solve both classification and regression problems. kNN is most widely used as a first step in any machine learning setup. It is often used as a benchmark for more complex classifiers such as Artificial Neural Networks (ANN) and Support Vector Machines (SVM).

This program performs the following functions:

  • Write a python code to split the fruit dataset into 60:40 (train:test)

  • First 60% of the data is train and the bottom 40% is test

  • Write the code for the K-nearest neighbor algorithm using Euclidean distance as a measure of dissimilarity

  • Find the value of K which gives the best prediction accuracy (iterate K starting from 1 to 10)

  • Plot the graph for prediction accuracy vs the value of K

About

KNN is a simple, supervised machine learning algorithm that can be used to solve both classification and regression problems. This was built from scratch.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages