k-Neareast Neighbor algorithm (k-NN) is a non-parametric method used for classification. In this case we used k-NN for predict the class of given test data using train data to find the best k for this case.
Calculation of the distance used in this program is using the Euclidean Distance. Euclidean distance used because it is the "ordinary" straight-line distance between two points.
The validation used in this program is using Cross Validation. For this program the data propotion for validation set and test set is 25% and 75% respectively in random manner.
Based on the observation of validation process using Cross Validation, we get the best K is 37 with accuracy of 71.5%.
Open Prediksi_Tugas2AI_13-1174099.csv
$ go get github.com/ehardi19/tetangga-terdekat
$ cd $GOPATH/src/github.com/ehardi19/tetangga-terdekat
$ go run main.go