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

UN
Uni24h
0 lượt tải
46
0

Nội dung tài liệu

Trang 1

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

Trang 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

Trang 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

Trang 10

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

Trang 13

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

Trang 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

Trang 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

Trang 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

Trang 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

Trang 19

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

Trang 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

Hiển thị 20 trang đầu. Tải tài liệu để xem đầy đủ.

Bình luận (0)

Đăng nhập để tham gia bình luận

Chưa có bình luận nào. Hãy là người đầu tiên!