Session Ready
Exercise

k-means clustering

We have created some two-dimensional data and stored it in a variable called x in your workspace. The scatter plot on the right is a visual representation of the data.

In this exercise, your task is to create a k-means model of the x data using 3 clusters, then to look at the structure of the resulting model using the summary() function.

Instructions
100 XP
  • Fit a k-means model to x using 3 centers and run the k-means algorithm 20 times. Store the result in km.out.
  • Inspect the result with the summary() function.