ComenzarEmpieza gratis

Build 4-cluster solution

Perfect, you can see the the recommended number of clusters is somewhere between 3 and 4. Now, you will build the latter number of clusters in this exercise.

The normalized RFMT dataset is available as datamart_rfmt_normalized, feel free to use the console to explore it.

Este ejercicio forma parte del curso

Customer Segmentation in Python

Ver curso

Instrucciones del ejercicio

  • Import KMeans from sklearn library.
  • Initialize KMeans with 4 clusters and random state 1.
  • Fit k-means clustering on the normalized data set.
  • Extract cluster labels and store them as cluster_labels object.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Import KMeans 
from ____.____ import ____

# Initialize KMeans
kmeans = ____(____, ____) 

# Fit k-means clustering on the normalized data set
____.____(____)

# Extract cluster labels
cluster_labels = ____.____
Editar y ejecutar código