Skip to content

Implementing KNN Algorithm for classification iris dataset according to sepal length and sepal width.

Notifications You must be signed in to change notification settings

khadija267/KNN-Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

KNN-Implementation

Implementing KNN Algorithm for classification iris dataset according to sepal length and sepal width.

Iris Dataset:

the iris flower dataset. The dataset consists of 150 data points where each data point is a feature vector describing the attribute of a flower in the dataset, the four dimensions represent:

sepal length in cm
sepal width in cm
petal length in cm
petal width in cm

and the corresponding target y∈ℤ describes the class of the flower. It uses the integers 0, 1 and 2 And we will deal with first 2 dimensions.

to represent the 3 classes of flowers in this dataset.

Iris Setosa
Iris Versicolour
Iris Virginica

How KNN works:

As any classification algorithm it takes input some data and use the data to determine which class (category) this piece of data belongs to. The idea: Given a training set X∈ℝN×D and y∈ℤN, we predict the label of a new point x∈ℝD as the label of the majority of its "K nearest neighbor" (hence the name KNN) by some distance measure (e.g the Euclidean distance). Here, N is the number of data points in the dataset, and D is the dimensionality of the data.

About

Implementing KNN Algorithm for classification iris dataset according to sepal length and sepal width.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published