Skip to content
← All questions

What information is contained in the object returned by the R kmeans function?

The object returned by the kmeans function contains a cluster assignment for each data point and the coordinate location of the center of each cluster.

Reasoning, step by step

  1. Run the kmeans function on a dataset.
  2. Inspect the returned object.
  3. Identify the clustering vector, which assigns each data point to a cluster.
  4. Identify the cluster means, which provide the coordinates of each cluster's center.

Example

The speaker explains that the resulting kmeans object contains valuable information, including a cluster assignment for each data point and the coordinate location of each cluster's center.

Common misconceptions

  • Thinking the object only contains the final cluster labels.
  • Assuming the cluster centers are not included in the output object.

Watch the explanation

Explore next

Answers are generated from source material and independently checked. Consult the original video or creator if something is unclear.