- General Info
- Creator Info
- Features
- Technologies Used
- Setup
- Usage
- Screenshots
- Structure
- Project Status
- Room for Improvement
- Acknowledgements
- Contact
A simple program to implement K-Nearest Neighbor algorithm. The program will randomly generate 1000 data points with 2 features (x and y). The program will then ask user input for X and Y value that want to be assigned as pivot point. After that, the program will ask user input for K value. The program will then calculate the distance between the pivot point and all the data points. The program will then sort the data points based on the distance from the pivot point. The program will then show the K nearest data points to the pivot point. This program is made for GIK research program - ML Topics at Week01-March.
Nama | NIM | |
---|---|---|
Mohammad Rifqi Farhansyah | 13521166 | 13521166@std.stei.itb.ac.id |
- Generate
1000 data points
with 2 features (x and y) - Ask user input for
X
andY
value that want to be assigned as pivot point - Ask user input for
K
value Calculate the distance between
the pivot point and all the data pointsSort the data points
based on the distance from the pivot point- Show the
K nearest data points
to the pivot point Visualize the data points and the pivot point
with different color (using GNUPlot)
- MingGw-W64 version 8.1.0
Note: The version of the libraries above is the version that we used in this project. You can use the latest version of the libraries.
- Download the MingW-W64 from here.
- Install the MingW-W64.
- Open the terminal in the project directory.
cd output
and thenk_nearest_neighbor.exe
to run the program.- Input the X and Y value that want to be assigned as pivot point.
- Input the K value.
- The program will then calculate the distance between the pivot point and all the data points.
- Program will sort the data points based on the distance from the pivot point.
- KNN Simple Program will output the K nearest data points to the pivot point.
- The program will then visualize the data points and the pivot point with different color (using GNUPlot).
Figure 1. Main Menu
Figure 2. Nearest Points Output
Figure 3. Visualization of The Points
│ Doc.docx
│ gnu_plot_script.plt
│ k_nearest_neighbour.cpp
│ README.md
│
├───.vscode
│ c_cpp_properties.json
│ launch.json
│ settings.json
│
├───image
│ SS1.png
│ SS2.png
│ SS3.png
│
└───output
k_nearest_neighbour.exe
near_points_file.txt
Project is: complete
Room for Improvement:
- Optimalization of the KNN algorithm
- Add more features
- Thanks To Allah SWT