Selasa, 08 Agustus 2023

Calculation of K-Nearest Neighbor With Minkowsky Distance

In this post, I will discuss the calculation of K-Nearest Neighbor with Minkowsky Distance.

The classification that will be discussed is the Classification of Scholarship Recipients.

The data we will use is:

  • Consists of 10 data
  • Consists of 2 criteria
  • K = 5
  • r Minkowsky = 4


Information :
  • Which will be categorized consists of Non-Academic values ​​and Academic values.
  • Status consists of Not Qualified and Qualified.
  • What we will classify is Name = See, Non-Academic Value = 81 and Academic Value = 86, Status = ?
 
Calculation (formula to be used) :


  • 79 is Alan's Non-Academic score
  • 81 is See's Non-Academic score
  • 97 is Alan's Academic score
  • 86 is See's Academic score
  • 1/4 is a power value, because r = 4
  • Then do the same calculations on data belonging to Dani, Rey and so on.

Then the calculation will be obtained as follows :


After that, do the ranking from the smallest to the largest value, the results obtained are as follows :


After getting the ranking, we can ensure that on behalf of See is eligible to receive a Scholarship or Not Eligible to receive a Scholarship.


Explanation :
  • If using K=1 then the result is Not Qualified because Moon the result is Not Qualified.
  • If using K=3 then the result is Not Qualified because Dani's result is Qualified, while Moon and Tet the result is Not Qualified (Qualified is 1 and Unqualified is 2).
  • If using K=5 then the result is Not Qualified because Dani's result is Qualified, while Moon, Tet, Cee and Jo the result is Not Qualified (Qualified is 1 and Unqualified is 4).

So that the final result of See Not Qualifying


Notes :
  • The value of K is independent (try to have an odd number so it doesn't confuse us when there are the same number of voting results).

Tidak ada komentar:

Posting Komentar