kNN implementation in Python
Following steps should be performed before running the code:
-
The correct training data set (any 10-dobscv) should be downloaded from keel. Any dataset would work (recommended is heart or banana, have included them in the repo). Extract the zip and copy the data folder besides the shantanu_deshmukh_knn.py file
-
For plotting the graph, I have used matplotlib, so to install it use -> sudo apt-get install python-matplotlib
That’s it, now simply RUN the program..
Highlights of the program :
- Automates the tasks to study how accuracy depends on the value of k.
- Can evaluate accuracy of KNN on any 10-dobscv dataset on Keel
- Plot graphs to illustrate accuracy for different datasets and K values
- Intelligently use information contained in the @attribute field to select the most appropriate distance metric
- There is an option to run the program directly using command line arguments besides the command line menu that appears on running the program directly
Output of the program - Accuracy vs value of K graph:
10-fold Cross Validation, accuracy vs iteration graph:
Refer the README pdf for more detailed steps with screenshots on running the program
Datasets used from - http://sci2s.ugr.es/keel/category.php?cat=clas Thankyou Keel for the datasets..