Distance between two observations

Phân cụm bằng R

Dmitriy (Dima) Gorenshteyn

Lead Data Scientist, Memorial Sloan Kettering Cancer Center

Distance vs. Similarity

Phân cụm bằng R

Distance vs. Similarity

       

$$Distance = 1 - Similarity$$
Phân cụm bằng R

Distance between two players

soccer_1

Phân cụm bằng R

Distance between two players

soccer_2

Phân cụm bằng R

Distance between two players

soccer_3

Phân cụm bằng R

Distance between two players

soccer_4

Phân cụm bằng R

Distance between two players

soccer_6

Phân cụm bằng R

Distance between two players

soccer_7

Phân cụm bằng R

Distance between two players

soccer_8

Phân cụm bằng R

Distance between two players

soccer_9

Phân cụm bằng R

Distance between two players

soccer_12

Phân cụm bằng R

dist() function

print(two_players)
     X  Y
BLUE 0  0
RED  9 12
dist(two_players, method = 'euclidean')
      BLUE
RED   15
Phân cụm bằng R

More than 2 observations

print(three_players)
       X  Y
BLUE   0  0
RED    9 12
GREEN -2 19
dist(three_players)
          BLUE      RED
RED   15.00000         
GREEN 19.10497 13.03840
Phân cụm bằng R

Let's practice!

Phân cụm bằng R

Preparing Video For Download...