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

Зміст курсу

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?

Завдання

  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.

Завдання

  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.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 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?

Завдання

  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.

Завдання

  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.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 1. Розділ 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?

Завдання

  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.

Завдання

  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.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

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

Завдання

  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.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 1. Розділ 5
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt