Skip to content

A simple implementation of K Nearest Neighbors classifier model in python.

Notifications You must be signed in to change notification settings

mahesh147/K-Nearest-Neighbors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

K-Nearest-Neighbors

A simple implementation of K Nearest Neighbors classifier model in python. The classifier object is created using the KNeighborClassifier class which was imported from sklearn.neighbors.

The parameters passed into the KNeighborsClassifier include:

  • n_neighbors = 5. This is the default value of the n_neighbors argument. Increasing the value of n_neighbors increases the value of K. For example, if n_neighbors is given a value of 5, the number of neighbors taken for comparing the value of the new data point will be 5.

  • metric = 'minkowski'. This metric uses Euclidean metric.

  • p = 2. This is the power parameter. The value 2 is given for Eculidean distance.

A confusion martrix is later created to determine the accuracy of the model.

About

A simple implementation of K Nearest Neighbors classifier model in python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages