Exercise

Elbow method on distinct clusters

Let us use the comic con dataset to see how the elbow plot looks on a dataset with distinct, well-defined clusters. You may want to display the data points before proceeding with the exercise.

The data is stored in a pandas DataFrame, comic_con. x_scaled and y_scaled are the column names of the standardized X and Y coordinates of people at a given point in time.

Instructions 1/2

undefined XP
    1
    2
  • Create a list of distortions for each cluster in num_clusters.
  • Create a DataFrame elbow_plot with num_clusters and distortions.
  • With the .lineplot() method, plot elbow_plot with num_clusters in the x axis and distortions in the y axis.