(After coverting the .ipynb files to .py)
Run the code with the following command in the terminal,
python AI_Kmeans.py python AI_KNN.py
FOR K-MEANS:
When run the code will prompt to enter the loction of all centroids (space between two different centroids) eg, 0,0 20,20 are two centroids (0, 0) and (20, 20)
Next the code will prompt to enter the input file name, here input the name of the file with extention.
Next, the code will prompt will ask to input distance calculation metric (manh/e2). e2 is the default.
After executing the code will print the all points belonging to a centroid gang and updated location of centroids.
It will prompt for an input. Here give the name of the input txt file with extension.
FOR KNN:
When run the code will prompt to enter the train file name. Here enter the name of the train file with extention.
Next the code will prompt to enter the enter test file name. Here enter the name of the test file with extention.
Next, the code will prompt will ask to enter distance calculation metric (manh/e2). e2 is the default.
Next, the code will prompt will ask to enter k value. 3 is the default k value
Next, the code will prompt will ask to enter the weighing method ((1/d)/unit). 1/d is the default.
After executing the code will print the labels assigned to all points as well as precision and recall for each label.
THANK YOU!!