ComeçarComece de graça

Results of kmeans()

The kmeans() function produces several outputs. In the video, we discussed one output of modeling, the cluster membership.

In this exercise, you will access the cluster component directly. This is useful anytime you need the cluster membership for each observation of the data used to build the clustering model. A future exercise will show an example of how this cluster membership might be used to help communicate the results of k-means modeling.

k-means models also have a print method to give a human friendly output of basic modeling results. This is available by using print() or simply typing the name of the model.

Este exercício faz parte do curso

Unsupervised Learning in R

Ver curso

Instruções do exercício

The k-means model you built in the last exercise, km.out, is still available in your workspace.

  • Print a list of the cluster membership to the console.
  • Use a print method to print out the km.out model.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Print the cluster membership component of the model


# Print the km.out object
Editar e executar o código