Skip to content

About

K-Nearest Neighbor algorithm implemented in Go

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

k-NN Implemented in Go

Description

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.

Implemenation

Distances

Calculation of the distance used in this program is using the Euclidean Distance. alt text Euclidean distance used because it is the "ordinary" straight-line distance between two points.

Validation

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.

K

Based on the observation of validation process using Cross Validation, we get the best K is 37 with accuracy of 71.5%.

Result

Open Prediksi_Tugas2AI_13-1174099.csv

Installation

 $ go get github.com/ehardi19/tetangga-terdekat
 $ cd $GOPATH/src/github.com/ehardi19/tetangga-terdekat

Running the Program

$ go run main.go

About

K-Nearest Neighbor algorithm implemented in Go

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages