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.
Swipe to start coding
Given cities' average temperatures dataset data. The numerical columns are 3 - 14.

Your tasks are:
- Using
forloop iterate overn_cl. Within the loop:
- Create
KMedoidsmodel withjclusters namedmodel. - Fit the 2-15 columns of
datato the model. Watch out that indices in Python start from 0. - Add silhouette score value to the
silhouetteslist. Remember to pass two parameters: the data used for fitting (the same 3-15 columns) and predicted bymodellabels.
- Visualize the results using
lineplotofsns. Passn_clasxparameter andsilhouettesasy. Do not forget to apply the.show()method to display the plot.
Рішення
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Сумаризуйте цей розділ
Пояснити код у file
Пояснити, чому file не вирішує завдання
Awesome!
Completion rate improved to 3.57
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.
Swipe to start coding
Given cities' average temperatures dataset data. The numerical columns are 3 - 14.

Your tasks are:
- Using
forloop iterate overn_cl. Within the loop:
- Create
KMedoidsmodel withjclusters namedmodel. - Fit the 2-15 columns of
datato the model. Watch out that indices in Python start from 0. - Add silhouette score value to the
silhouetteslist. Remember to pass two parameters: the data used for fitting (the same 3-15 columns) and predicted bymodellabels.
- Visualize the results using
lineplotofsns. Passn_clasxparameter andsilhouettesasy. Do not forget to apply the.show()method to display the plot.
Рішення
Дякуємо за ваш відгук!
single