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

Cutting the tree

Remember from the video that cutree() is the R function that cuts a hierarchical model. The h and k arguments to cutree() allow you to cut the tree based on a certain height h or a certain number of clusters k.

In this exercise, you will use cutree() to cut the hierarchical model you created earlier based on each of these two criteria.

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

Unsupervised Learning in R

ดูคอร์ส

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

The hclust.out model you created earlier is available in your workspace.

  • Cut the hclust.out model at height 7.
  • Cut the hclust.out model to create 3 clusters.

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

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

# Cut by height


# Cut by number of clusters
แก้ไขและรันโค้ด