Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
K-Medoids and the Weather Data | K-Medoids 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

K-Medoids and the Weather Data

As you can see, there was no such clear peek as in the example. That means that both 3 and 4 clusters may be a good choice!

Let's see what will be the result of using the K-Medoids algorithm for the weather data we used in the previous section. Let's start with defining the optimal number of clusters.

Завдання

Given cities' average temperatures dataset data. The numerical columns are 3 - 14. [object Object]

Your tasks are:

  1. Using for loop iterate over n_cl. Within the loop:
  • Create KMedoids model with j clusters named model.
  • Fit the 2-15 columns of data to the model. Watch out that indices in Python start from 0.
  • Add silhouette score value to the silhouettes list. Remember to pass two parameters: the data used for fitting (the same 3-15 columns) and predicted by model labels.
  1. Visualize the results using lineplot of sns. Pass n_cl as x parameter and silhouettes as y. Do not forget to apply the .show() method to display the plot.

Завдання

Given cities' average temperatures dataset data. The numerical columns are 3 - 14. [object Object]

Your tasks are:

  1. Using for loop iterate over n_cl. Within the loop:
  • Create KMedoids model with j clusters named model.
  • Fit the 2-15 columns of data to the model. Watch out that indices in Python start from 0.
  • Add silhouette score value to the silhouettes list. Remember to pass two parameters: the data used for fitting (the same 3-15 columns) and predicted by model labels.
  1. Visualize the results using lineplot of sns. Pass n_cl as x parameter and silhouettes as y. Do not forget to apply the .show() method to display the plot.

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

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

Секція 2. Розділ 4
toggle bottom row

K-Medoids and the Weather Data

As you can see, there was no such clear peek as in the example. That means that both 3 and 4 clusters may be a good choice!

Let's see what will be the result of using the K-Medoids algorithm for the weather data we used in the previous section. Let's start with defining the optimal number of clusters.

Завдання

Given cities' average temperatures dataset data. The numerical columns are 3 - 14. [object Object]

Your tasks are:

  1. Using for loop iterate over n_cl. Within the loop:
  • Create KMedoids model with j clusters named model.
  • Fit the 2-15 columns of data to the model. Watch out that indices in Python start from 0.
  • Add silhouette score value to the silhouettes list. Remember to pass two parameters: the data used for fitting (the same 3-15 columns) and predicted by model labels.
  1. Visualize the results using lineplot of sns. Pass n_cl as x parameter and silhouettes as y. Do not forget to apply the .show() method to display the plot.

Завдання

Given cities' average temperatures dataset data. The numerical columns are 3 - 14. [object Object]

Your tasks are:

  1. Using for loop iterate over n_cl. Within the loop:
  • Create KMedoids model with j clusters named model.
  • Fit the 2-15 columns of data to the model. Watch out that indices in Python start from 0.
  • Add silhouette score value to the silhouettes list. Remember to pass two parameters: the data used for fitting (the same 3-15 columns) and predicted by model labels.
  1. Visualize the results using lineplot of sns. Pass n_cl as x parameter and silhouettes as y. Do not forget to apply the .show() method to display the plot.

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

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

Секція 2. Розділ 4
toggle bottom row

K-Medoids and the Weather Data

As you can see, there was no such clear peek as in the example. That means that both 3 and 4 clusters may be a good choice!

Let's see what will be the result of using the K-Medoids algorithm for the weather data we used in the previous section. Let's start with defining the optimal number of clusters.

Завдання

Given cities' average temperatures dataset data. The numerical columns are 3 - 14. [object Object]

Your tasks are:

  1. Using for loop iterate over n_cl. Within the loop:
  • Create KMedoids model with j clusters named model.
  • Fit the 2-15 columns of data to the model. Watch out that indices in Python start from 0.
  • Add silhouette score value to the silhouettes list. Remember to pass two parameters: the data used for fitting (the same 3-15 columns) and predicted by model labels.
  1. Visualize the results using lineplot of sns. Pass n_cl as x parameter and silhouettes as y. Do not forget to apply the .show() method to display the plot.

Завдання

Given cities' average temperatures dataset data. The numerical columns are 3 - 14. [object Object]

Your tasks are:

  1. Using for loop iterate over n_cl. Within the loop:
  • Create KMedoids model with j clusters named model.
  • Fit the 2-15 columns of data to the model. Watch out that indices in Python start from 0.
  • Add silhouette score value to the silhouettes list. Remember to pass two parameters: the data used for fitting (the same 3-15 columns) and predicted by model labels.
  1. Visualize the results using lineplot of sns. Pass n_cl as x parameter and silhouettes as y. Do not forget to apply the .show() method to display the plot.

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

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

As you can see, there was no such clear peek as in the example. That means that both 3 and 4 clusters may be a good choice!

Let's see what will be the result of using the K-Medoids algorithm for the weather data we used in the previous section. Let's start with defining the optimal number of clusters.

Завдання

Given cities' average temperatures dataset data. The numerical columns are 3 - 14. [object Object]

Your tasks are:

  1. Using for loop iterate over n_cl. Within the loop:
  • Create KMedoids model with j clusters named model.
  • Fit the 2-15 columns of data to the model. Watch out that indices in Python start from 0.
  • Add silhouette score value to the silhouettes list. Remember to pass two parameters: the data used for fitting (the same 3-15 columns) and predicted by model labels.
  1. Visualize the results using lineplot of sns. Pass n_cl as x parameter and silhouettes as y. Do not forget to apply the .show() method to display the plot.

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