เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Exploring the clusters

Because clustering analysis is always in part qualitative, it is incredibly important to have the necessary tools to explore the results of the clustering.

In this exercise you will explore that data frame you created in the previous exercise lineup_k2_complete.

Reminder: The lineup_k2_complete data frame contains the x & y positions of 12 players at the start of a 6v6 soccer game to which you have added clustering assignments based on the following parameters:

  • Distance: Euclidean
  • Number of Clusters (k): 2
  • Linkage Method: Complete

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Cluster Analysis in R

ดูคอร์ส

คำแนะนำการฝึกหัด

  • Using count() from dplyr, count the number of players assigned to each cluster.
  • Using ggplot(), plot the positions of the players and color them by cluster assignment.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Count the cluster assignments
count(lineup_k2_complete, ___)

# Plot the positions of the players and color them using their cluster
ggplot(lineup_k2_complete, aes(x = ___, y = ___, color = factor(___))) +
  geom_point()
แก้ไขและรันโค้ด