ComeçarComece de graça

k-means clustering

We have created some two-dimensional data and stored it in a variable called x in your workspace. The scatter plot shown 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.

A scatter plot of the data used in the exercise.

Este exercício faz parte do curso

Unsupervised Learning in R

Ver curso

Instruções do exercício

  • 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.

Exercício interativo prático

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

# Create the k-means model: km.out


# Inspect the result
Editar e executar o código