kNN algorithm

NAI - Artificial Intelligence Tools

Course Assignment

This program is my implementation of kNN( k-nearest neighbors) algorithm for Iris flowers dataset.

What's it all about?

Program reads the data from training set of characteristics and names of 4 species of Iris flower, asks about k number and task of the program is to find(with highest accuracy) specie of new unknown flower, knowing only its characteristics, or to classify each case from the test set.

How to Run?

  • Run Code

You can decide to run program on test file or your own input data

Running through the test file:

  • Enter name of the train file:
train.txt
  • Enter name of the test file:
test.txt
  • Enter the K value (number of neighbors)

Running through your own input:

  • Enter 4 characteristics of a flower(Ex. 4.5,3.6,2.5,4.6)
  • Enter name of your flower
  • Enter the K value (number of neighbors)

Authors