This Project Implements the KNN Algorithm in C
Simple Lazy-Learing Algorithm to get going with Machine Learning
- Claculate all the Euclidean Distances to the Trained Points
- Sort them by the Distance Asccending
- Filter out the smallest N Values
Is used to Calulate the Distance between 2 Points in a Multidimensional Room:
√((p1_1 - p2_1)^2 + (p1_2 - p2_2)^2 + ... + (p1_x - p2_x)^2))
Build the knn Binary:
make build
Run the knn:
make run
Clean the Project:
make clean
- To Specify the DataSet, you have to Change the "convertToIrisPoint" Function to match your File Format
- Change the trainDataSize Var to specify how many Lines should be loaded
- Change the classes Array to change the meaning of the Classes
- Change the "toClassify" Array to set the Point that should be classified
- Change the K to Specify how many of the Naighbours should be looked at