The Weather Data and Linkages
Let's see how will the dendrograms with different linkage
parameter values will look like for the weather data.
Note, that to explore the task's result you will need to scroll over the output block on the right and below.
Swipe to start coding

For the weather data stored in the data
variable build the dendrograms for each of 4 types of linkage
('single'
, 'average'
, 'complete'
, and 'ward'
. These are already stored in the linkages
list). Follow the next steps:
- Import the functions needed:
AgglomerativeClustering
fromsklearn.cluster
.dendrogram
andlinkage
fromscipy.cluster.hierarchy
.
- Iterate over the
linkages
list using the dummy variablelink
. - Within the
dist
variable compute the distances using 3-14 (these are positions, not indices!) columns ofdata
, and passing themethod
parameter tolink
. - Build the dendrogram for
dist
, settingno_labels
toTrue
.
Рішення
Note, that you received four dendrograms in the console. To explore them scroll the console down.
Дякуємо за ваш відгук!
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Awesome!
Completion rate improved to 3.57
The Weather Data and Linkages
Свайпніть щоб показати меню
Let's see how will the dendrograms with different linkage
parameter values will look like for the weather data.
Note, that to explore the task's result you will need to scroll over the output block on the right and below.
Swipe to start coding

For the weather data stored in the data
variable build the dendrograms for each of 4 types of linkage
('single'
, 'average'
, 'complete'
, and 'ward'
. These are already stored in the linkages
list). Follow the next steps:
- Import the functions needed:
AgglomerativeClustering
fromsklearn.cluster
.dendrogram
andlinkage
fromscipy.cluster.hierarchy
.
- Iterate over the
linkages
list using the dummy variablelink
. - Within the
dist
variable compute the distances using 3-14 (these are positions, not indices!) columns ofdata
, and passing themethod
parameter tolink
. - Build the dendrogram for
dist
, settingno_labels
toTrue
.
Рішення
Note, that you received four dendrograms in the console. To explore them scroll the console down.
Дякуємо за ваш відгук!
Awesome!
Completion rate improved to 3.57single