Skip to content

Commit 3ef289f

Browse files
added captions to unreffed figs in clustering
1 parent 1d4aef6 commit 3ef289f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clustering.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ clustered_data
777777
Now that we have this information in a tidy data frame, we can make a visualization
778778
of the cluster assignments for each point, as shown in Figure \@ref(fig:10-plot-clusters-2).
779779

780-
```{r 10-plot-clusters-2, fig.height = 4, fig.width = 4.35, fig.align = "center"}
780+
```{r 10-plot-clusters-2, fig.height = 4, fig.width = 4.35, fig.align = "center", fig.cap = "The data colored by the cluster assignments returned by K-means."}
781781
cluster_plot <- ggplot(clustered_data,
782782
aes(x = flipper_length_mm,
783783
y = bill_length_mm,
@@ -885,7 +885,7 @@ clustering_statistics
885885
Now that we have `tot.withinss` and `k` as columns in a data frame, we can make a line plot
886886
(Figure \@ref(fig:10-plot-choose-k)) and search for the "elbow" to find which value of K to use.
887887

888-
```{r 10-plot-choose-k, fig.height = 4, fig.width = 4.35, fig.align = "center"}
888+
```{r 10-plot-choose-k, fig.height = 4, fig.width = 4.35, fig.align = "center", fig.cap = "A plot showing the total WSSD versus the number of clusters."}
889889
elbow_plot <- ggplot(clustering_statistics, aes(x = k, y = tot.withinss)) +
890890
geom_point() +
891891
geom_line() +
@@ -919,7 +919,7 @@ but there is a trade-off that doing many clusterings
919919
could take a long time.
920920
So this is something that needs to be balanced.
921921

922-
```{r 10-choose-k-nstart, fig.height = 4, fig.width = 4.35, message= F, warning = F}
922+
```{r 10-choose-k-nstart, fig.height = 4, fig.width = 4.35, message= F, warning = F, fig.cap = "A plot showing the total WSSD versus the number of clusters when K-means is run with 10 restarts."}
923923
penguin_clust_ks <- tibble(k = 1:9) |>
924924
rowwise() |>
925925
mutate(penguin_clusts = list(kmeans(standardized_data, nstart = 10, k)),

0 commit comments

Comments
 (0)