Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
How Similar are the Results? | Hierarchical Clustering
Cluster Analysis in Python
course content

Conteúdo do Curso

Cluster Analysis in Python

Cluster Analysis in Python

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

How Similar are the Results?

Well done! Let's look at the last line charts you built in the previous chapter.

As you can see, only the ward linkage could catch the 'downward up to July' trend. Both results are different. But let's find out how different they are using the rand index.

Tarefa

Table

Compute the rand index to compare the results of using complete and ward linkages. Follow the next steps:

  1. Import functions needed:
  • rand_score from sklearn.metrics.
  • AgglomerativeClustering from sklearn.cluster.
  1. Create two models model_complete and model_ward performing a hierarchical clustering with 4 clusters both and 'complete' and 'ward' linkages respectively.
  2. Fit the 3-14 columns of data to models and predict the labels. Save the labels for model_complete within labels_complete and for model_ward within labels_ward.
  3. Compute the rand index using labels_complete and labels_ward.

Tarefa

Table

Compute the rand index to compare the results of using complete and ward linkages. Follow the next steps:

  1. Import functions needed:
  • rand_score from sklearn.metrics.
  • AgglomerativeClustering from sklearn.cluster.
  1. Create two models model_complete and model_ward performing a hierarchical clustering with 4 clusters both and 'complete' and 'ward' linkages respectively.
  2. Fit the 3-14 columns of data to models and predict the labels. Save the labels for model_complete within labels_complete and for model_ward within labels_ward.
  3. Compute the rand index using labels_complete and labels_ward.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 3. Capítulo 8
toggle bottom row

How Similar are the Results?

Well done! Let's look at the last line charts you built in the previous chapter.

As you can see, only the ward linkage could catch the 'downward up to July' trend. Both results are different. But let's find out how different they are using the rand index.

Tarefa

Table

Compute the rand index to compare the results of using complete and ward linkages. Follow the next steps:

  1. Import functions needed:
  • rand_score from sklearn.metrics.
  • AgglomerativeClustering from sklearn.cluster.
  1. Create two models model_complete and model_ward performing a hierarchical clustering with 4 clusters both and 'complete' and 'ward' linkages respectively.
  2. Fit the 3-14 columns of data to models and predict the labels. Save the labels for model_complete within labels_complete and for model_ward within labels_ward.
  3. Compute the rand index using labels_complete and labels_ward.

Tarefa

Table

Compute the rand index to compare the results of using complete and ward linkages. Follow the next steps:

  1. Import functions needed:
  • rand_score from sklearn.metrics.
  • AgglomerativeClustering from sklearn.cluster.
  1. Create two models model_complete and model_ward performing a hierarchical clustering with 4 clusters both and 'complete' and 'ward' linkages respectively.
  2. Fit the 3-14 columns of data to models and predict the labels. Save the labels for model_complete within labels_complete and for model_ward within labels_ward.
  3. Compute the rand index using labels_complete and labels_ward.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Seção 3. Capítulo 8
toggle bottom row

How Similar are the Results?

Well done! Let's look at the last line charts you built in the previous chapter.

As you can see, only the ward linkage could catch the 'downward up to July' trend. Both results are different. But let's find out how different they are using the rand index.

Tarefa

Table

Compute the rand index to compare the results of using complete and ward linkages. Follow the next steps:

  1. Import functions needed:
  • rand_score from sklearn.metrics.
  • AgglomerativeClustering from sklearn.cluster.
  1. Create two models model_complete and model_ward performing a hierarchical clustering with 4 clusters both and 'complete' and 'ward' linkages respectively.
  2. Fit the 3-14 columns of data to models and predict the labels. Save the labels for model_complete within labels_complete and for model_ward within labels_ward.
  3. Compute the rand index using labels_complete and labels_ward.

Tarefa

Table

Compute the rand index to compare the results of using complete and ward linkages. Follow the next steps:

  1. Import functions needed:
  • rand_score from sklearn.metrics.
  • AgglomerativeClustering from sklearn.cluster.
  1. Create two models model_complete and model_ward performing a hierarchical clustering with 4 clusters both and 'complete' and 'ward' linkages respectively.
  2. Fit the 3-14 columns of data to models and predict the labels. Save the labels for model_complete within labels_complete and for model_ward within labels_ward.
  3. Compute the rand index using labels_complete and labels_ward.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo

Tudo estava claro?

Well done! Let's look at the last line charts you built in the previous chapter.

As you can see, only the ward linkage could catch the 'downward up to July' trend. Both results are different. But let's find out how different they are using the rand index.

Tarefa

Table

Compute the rand index to compare the results of using complete and ward linkages. Follow the next steps:

  1. Import functions needed:
  • rand_score from sklearn.metrics.
  • AgglomerativeClustering from sklearn.cluster.
  1. Create two models model_complete and model_ward performing a hierarchical clustering with 4 clusters both and 'complete' and 'ward' linkages respectively.
  2. Fit the 3-14 columns of data to models and predict the labels. Save the labels for model_complete within labels_complete and for model_ward within labels_ward.
  3. Compute the rand index using labels_complete and labels_ward.

Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 3. Capítulo 8
Mude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
We're sorry to hear that something went wrong. What happened?
some-alt