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.outmodel at height 7. - Cut the
hclust.outmodel to create 3 clusters.
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Cut by height
# Cut by number of clusters