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

Conteúdo do Curso

Cluster Analysis in Python

Cluster Analysis in Python

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

book
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?

Tarefa

Swipe to start coding

  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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 5
toggle bottom row

book
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?

Tarefa

Swipe to start coding

  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.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 5
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Sentimos muito que algo saiu errado. O que aconteceu?
some-alt