Professional Documents
Culture Documents
03 KNN Analogy 1 Rev2021
03 KNN Analogy 1 Rev2021
03 KNN Analogy 1 Rev2021
http://www.free-powerpoint-templates-design.com
Classification Model
K-Nearest Neighbor
Classifier
K-Nearest Neighbor Classifiers
Learning by analogy:
Tell me who your friends are and I’ll tell you
who you are
A new example is assigned to the most common
class among the (K) examples that are most
similar to it.
K-Nearest Neighbor Algorithm
• Untuk menentukan kelas dari data baru F:
• Hitung jarak antara F dengan semua data dalam data pelatihan (training set)
• Pilih sejumlah K data terdekat dengan F dari data pelatihan
• Tetapkan F ke kelas paling banyak di antara tetangga terdekat dalam K
Response
No response No response
John: Rachel:
Age=35 Age=41
Income=135K Income=50K
No. of credit cards=3 No. of credit cards=2
• Tidak ada model yang dibuat: catat semua data pelatihan (training set)
• Pemrosesan hanya dilakukan jika ada data baru yang harus diklasifikasikan.
Rachel 41 50K 2 No
Hannah 63 200K 1 No
Tom 59 170K 1 No
Strengths:
Simple to implement and use
Comprehensible – easy to explain prediction
Robust to noisy data by averaging k-nearest neighbors.
Some appealing applications (will discuss next in personalization )
Weaknesses:
Need a lot of space to store all examples.
Takes more time to classify a new example than with a model (need
to calculate and compare distance from new example to all other
examples).
Section Break
Insert the Subtitle of Your Presentation
K-Nearest Neighbor Classifier
Classification Tree Modes K-Nearest Neighbors
Customer Age Income No. credit Response
cards
Rachel 41 50K 2 No
Yes No Hannah 63 200K 1 No
Tom 59 170K 1 No
Yes No
No No cards>1 Response
Response No response No
Yes No response
John: Rachel:
Age=35 Age=41
Inco me=135K Income=50K
No. of credit cards=3 No. of credit cards=2
Normalization of Variables
Customer Age Income No. Response
(K) cards
Tugas Anda
Rachel No 41 50K 2 No
Hannah No 63 200K 1 No
Data Kategorik
kategori lainnya. Contohnya seperti status perkawinan, jenis pekerjaan, dan
jenis kelamin.
https://dqlab.id/digital-transformation-kenali-macam-macam-data-dalam-ilmu-data-science