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

UN
Uni24h
0 Downloads
46
0

Inhalt des Dokuments

Seite 1

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

Seite 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

Seite 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

Seite 10

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

Seite 13

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

Seite 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

Seite 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

Seite 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

Seite 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

Seite 19

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

Seite 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

Die ersten 20 Seiten werden angezeigt. Laden Sie das Dokument herunter, um alles zu sehen.

Kommentare (0)

Anmelden um an der Diskussion teilzunehmen

Noch keine Kommentare. Seien Sie der Erste!