Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele The Weather Data and Linkages | Hierarchical Clustering
Cluster Analysis in Python
course content

Kurssisisältö

Cluster Analysis in Python

Cluster Analysis in Python

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

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

Tehtävä

Swipe to start coding

Table

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:

  1. Import the functions needed:
  • AgglomerativeClustering from sklearn.cluster.
  • dendrogram and linkage from scipy.cluster.hierarchy.
  1. Iterate over the linkages list using the dummy variable link.
  2. Within the dist variable compute the distances using 3-14 (these are positions, not indices!) columns of data, and passing the method parameter to link.
  3. Build the dendrogram for dist, setting no_labels to True.

Ratkaisu

Note, that you received four dendrograms in the console. To explore them scroll the console down.

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 5
toggle bottom row

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

Tehtävä

Swipe to start coding

Table

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:

  1. Import the functions needed:
  • AgglomerativeClustering from sklearn.cluster.
  • dendrogram and linkage from scipy.cluster.hierarchy.
  1. Iterate over the linkages list using the dummy variable link.
  2. Within the dist variable compute the distances using 3-14 (these are positions, not indices!) columns of data, and passing the method parameter to link.
  3. Build the dendrogram for dist, setting no_labels to True.

Ratkaisu

Note, that you received four dendrograms in the console. To explore them scroll the console down.

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 3. Luku 5
Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Pahoittelemme, että jotain meni pieleen. Mitä tapahtui?
some-alt