File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -168,8 +168,17 @@ kmeans_fit %>%
168168 extract_centroids()
169169```
170170
171- Based on the above output, we might say that Cluster_1 is penguins with smaller
172- bill lengths, Cluster_2 has smaller bill depths, and Cluster_3 is penguins with
171+ ``` {r, echo=FALSE}
172+ centroids <- extract_centroids(kmeans_fit)
173+
174+ small_length <- centroids$.cluster[which.min(centroids$bill_length_mm)]
175+ small_depth <- centroids$.cluster[which.min(centroids$bill_depth_mm)]
176+ other <- setdiff(levels(centroids$.cluster), c(small_length, small_depth))
177+ ```
178+
179+
180+ Based on the above output, we might say that ` r small_length ` is penguins with smaller
181+ bill lengths, ` r small_depth ` has smaller bill depths, and ` r other ` is penguins with
173182large bills in both dimensions.
174183
175184## Prediction
You can’t perform that action at this time.
0 commit comments