Once the clustering object is created, the K-means algorithm is applied using the command `clustering.kmeans()`. Because the data set is stored within the clustering object, multiple algorithms can be run and easily compared using the same input data set. In this example, the k-means algorithm is used for clustering. To switch to a different algorithm, one needs to change `kmeans` to another algorithm, such as `hierarchical` for hierarchical clustering.