Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Case 2: Four Distinct Clusters | K-Means Algorithm
Cluster Analysis in Python
course content

Contenido del Curso

Cluster Analysis in Python

Cluster Analysis in Python

1. K-Means Algorithm
2. K-Medoids Algorithm
3. Hierarchical Clustering
4. Spectral Clustering

Case 2: Four Distinct Clusters

Well, I think that the model did good work. But what if we try to divide the points into 4 groups?

Tarea

  1. Import necessary libraries with their standard aliases. These are pandas (pd), matplotlib.pyplot (plt), seaborn (sns), and KMeans from sklearn.cluster.
  2. Create a KMeans model object with 4 clusters.
  3. Fit the data to the model.
  4. Predict the labels for data. Save the result within the 'prediction' column of data.
  5. Build scatter plot for 'x' and 'y' columns of data with each point being painted with respect to the 'prediction' column.

Tarea

  1. Import necessary libraries with their standard aliases. These are pandas (pd), matplotlib.pyplot (plt), seaborn (sns), and KMeans from sklearn.cluster.
  2. Create a KMeans model object with 4 clusters.
  3. Fit the data to the model.
  4. Predict the labels for data. Save the result within the 'prediction' column of data.
  5. Build scatter plot for 'x' and 'y' columns of data with each point being painted with respect to the 'prediction' column.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 1. Capítulo 5
toggle bottom row

Case 2: Four Distinct Clusters

Well, I think that the model did good work. But what if we try to divide the points into 4 groups?

Tarea

  1. Import necessary libraries with their standard aliases. These are pandas (pd), matplotlib.pyplot (plt), seaborn (sns), and KMeans from sklearn.cluster.
  2. Create a KMeans model object with 4 clusters.
  3. Fit the data to the model.
  4. Predict the labels for data. Save the result within the 'prediction' column of data.
  5. Build scatter plot for 'x' and 'y' columns of data with each point being painted with respect to the 'prediction' column.

Tarea

  1. Import necessary libraries with their standard aliases. These are pandas (pd), matplotlib.pyplot (plt), seaborn (sns), and KMeans from sklearn.cluster.
  2. Create a KMeans model object with 4 clusters.
  3. Fit the data to the model.
  4. Predict the labels for data. Save the result within the 'prediction' column of data.
  5. Build scatter plot for 'x' and 'y' columns of data with each point being painted with respect to the 'prediction' column.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 1. Capítulo 5
toggle bottom row

Case 2: Four Distinct Clusters

Well, I think that the model did good work. But what if we try to divide the points into 4 groups?

Tarea

  1. Import necessary libraries with their standard aliases. These are pandas (pd), matplotlib.pyplot (plt), seaborn (sns), and KMeans from sklearn.cluster.
  2. Create a KMeans model object with 4 clusters.
  3. Fit the data to the model.
  4. Predict the labels for data. Save the result within the 'prediction' column of data.
  5. Build scatter plot for 'x' and 'y' columns of data with each point being painted with respect to the 'prediction' column.

Tarea

  1. Import necessary libraries with their standard aliases. These are pandas (pd), matplotlib.pyplot (plt), seaborn (sns), and KMeans from sklearn.cluster.
  2. Create a KMeans model object with 4 clusters.
  3. Fit the data to the model.
  4. Predict the labels for data. Save the result within the 'prediction' column of data.
  5. Build scatter plot for 'x' and 'y' columns of data with each point being painted with respect to the 'prediction' column.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Well, I think that the model did good work. But what if we try to divide the points into 4 groups?

Tarea

  1. Import necessary libraries with their standard aliases. These are pandas (pd), matplotlib.pyplot (plt), seaborn (sns), and KMeans from sklearn.cluster.
  2. Create a KMeans model object with 4 clusters.
  3. Fit the data to the model.
  4. Predict the labels for data. Save the result within the 'prediction' column of data.
  5. Build scatter plot for 'x' and 'y' columns of data with each point being painted with respect to the 'prediction' column.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 1. Capítulo 5
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt