1 / 6

K Nearest Neighbour

K Nearest Neighbour. Nearest Neighbour Rule. Tersedia beberapa data (x,y) yang terklasifikasi menjadi 2 kelas. Diberikan query point q, titik ini akan ditentukan masuk ke kelas mana. k = 1.

Télécharger la présentation

K Nearest Neighbour

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. K Nearest Neighbour

  2. Nearest Neighbour Rule Tersedia beberapa data (x,y) yang terklasifikasi menjadi 2 kelas Diberikan query point q, titik ini akan ditentukan masuk ke kelas mana k = 1 Menghitung sejumlah k tetangga terdekatnya dan menentukan kelas dari query point tsb dengan majority vote k = 3

  3. Matlab • Class = knnclassify(Sample, Training, Group)Class = knnclassify(Sample, Training, Group, k) • Sample : Matrik yang setiapbarisnyamerupakantitik-titikkueri • Training : Data yang diberikansebagaicalonneighbourdarikueri • Group : MatrikhasilklasifikasidariTraining • k : Berapa nearest neigbour yang akandihitung. Defaultnya 1. k=3 berarti 3 Nearest Neighbour

  4. Contoh • sample = [.9 .8;.1 .3;.2 .6] • training=[0 0;.5 .5;1 1] • group=[3;2;1] • Diberikantitik-titik training yang diklasifikasikansesuaimatrik group. Jikaadamatrik sample yang tiapbarisnyamerupakantitik-titikkueri. Bagaimanaklasifikasiuntukmatrik sample? Gunakan 3NearestNeigbour

  5. Data Fisik Mahasiswa • Diberikan 2 Kluster Pria dan Wanita • Data tinggi dan berat diketahui sbb Tini 155 50 Tino 175 63 Rini 160 55 Rino177 68 Dini 163 52 Dino 176 78 Tentukan clusterisasi data di atas dengan kmeans. Jika ada data mahasiswa baru sbb Mhs A 175 60 Mhs B 172,58 Mhs C 159, 55 . Masuk ke cluster manakah mahasiswa tsb (gunakan kNN)

  6. BuatGrafiknyasepertiini(x merupakan data baru)

More Related