Knn slides (02) (Phương pháp Nearest Neighbor trong học máy) - Sebastian Raschka

UN
Uni24h
0 downloads
46
0

Document content

Page 1

Lecture 02 Nearest Neighbor Methods STAT 479: Machine Learning, Fall 2018 Sebastian Raschka http://stat.wisc.edu/~sraschka/teaching/stat479-fs2018/ 1

Page 5

1-Nearest Neighbor Prediction Step closest_point := None closest_distance := for : current_distance := if current_distance < closest_distance: closest_distance := current_distance closest_point := return closest_point closest_point is the label of Sebastian Raschka STAT 479: Machine Learning FS 2018 !5

Page 6

Commonly used: Euclidean Distance (L2) m 2 d(x[a],x[b]) = x[a] − x[b] ∑( j j ) j=1 Sebastian Raschka STAT 479: Machine Learning FS 2018 !6

Page 10

a a Decision Boundary Between (a) and (c) d c Sebastian Raschka STAT 479: Machine Learning FS 2018 !10

Page 13

Which Point is Closest? Euclid distan a c ? b Sebastian Raschka STAT 479: Machine Learning FS 2018 !13

Page 14

a ? a ? b b Depends on the Distance Measure! Euclidean distance=1 Manhattan distance=1 a c ? ? b Sebastian Raschka STAT 479: Machine Learning FS 2018 !14

Page 15

Continuous Distance Measures Euclidean Manhattan 1 Minkowski: m p p d(x[a],x[b]) = x[a] − x[b] [∑( ) ] j=1 Mahalanobis ... Sebastian Raschka STAT 479: Machine Learning FS 2018 !15

Page 16

Discrete Distance Measures m Hamming: d(x[a],x[b]) = ∑ x[a] − x[b] j=1 Jaccard/Tanimoto Cosine similarity Dice ... Sebastian Raschka STAT 479: Machine Learning FS 2018 !16

Page 17

Feature Scaling Euclidean Euclidean distance=1 distance=1 c c a ? a ? b b Euclidean Sebastian Raschka STAT 479: Machine Learning distance=1FS 2018Manhattan !17 distance=1

Page 19

A y: Majority vote: Purality vote: B y: Majority vote: None Purality vote: Sebastian Raschka STAT 479: Machine Learning FS 2018 !19

Page 20

kNN for Classification 𝒟 = {⟨x[1], f(x[1])⟩,…,⟨x[k], f(x[k])⟩} 𝒟k ⊆ 𝒟 k Sebastian Raschka STAT 479: Machine Learning FS 2018 !20

Showing the first 20 pages. Download the document to see it all.

Comments (0)

Sign in to join the discussion

No comments yet. Be the first!