Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Mean Yearly Temperatures Across Clusters | 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

Mean Yearly Temperatures Across Clusters

The last chart we got was even harder to interpret than two chapters ago. But if we are talking about 'peeks', the number 4 best fits it.

Let's compare the yearly average temperatures across 4 predicted clusters.

Завдання

Calculate the yearly average temperatures across each cluster. The structure of data is shown below. [object Object]

Follow the next steps:

  1. Create a KMedoids model with 4 clusters named model.
  2. Fit the 3-15 (these are positions, not indices) columns of data to model.
  3. Add the 'prediction' column to data with predicted by model labels.
  4. Group the data DataFrame by the prediction column, then apply the .mean() function twice: the first call will calculate the monthly means, the second one (with axis = 1) will calculate the yearly averages.

Завдання

Calculate the yearly average temperatures across each cluster. The structure of data is shown below. [object Object]

Follow the next steps:

  1. Create a KMedoids model with 4 clusters named model.
  2. Fit the 3-15 (these are positions, not indices) columns of data to model.
  3. Add the 'prediction' column to data with predicted by model labels.
  4. Group the data DataFrame by the prediction column, then apply the .mean() function twice: the first call will calculate the monthly means, the second one (with axis = 1) will calculate the yearly averages.

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

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

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

Mean Yearly Temperatures Across Clusters

The last chart we got was even harder to interpret than two chapters ago. But if we are talking about 'peeks', the number 4 best fits it.

Let's compare the yearly average temperatures across 4 predicted clusters.

Завдання

Calculate the yearly average temperatures across each cluster. The structure of data is shown below. [object Object]

Follow the next steps:

  1. Create a KMedoids model with 4 clusters named model.
  2. Fit the 3-15 (these are positions, not indices) columns of data to model.
  3. Add the 'prediction' column to data with predicted by model labels.
  4. Group the data DataFrame by the prediction column, then apply the .mean() function twice: the first call will calculate the monthly means, the second one (with axis = 1) will calculate the yearly averages.

Завдання

Calculate the yearly average temperatures across each cluster. The structure of data is shown below. [object Object]

Follow the next steps:

  1. Create a KMedoids model with 4 clusters named model.
  2. Fit the 3-15 (these are positions, not indices) columns of data to model.
  3. Add the 'prediction' column to data with predicted by model labels.
  4. Group the data DataFrame by the prediction column, then apply the .mean() function twice: the first call will calculate the monthly means, the second one (with axis = 1) will calculate the yearly averages.

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

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

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

Mean Yearly Temperatures Across Clusters

The last chart we got was even harder to interpret than two chapters ago. But if we are talking about 'peeks', the number 4 best fits it.

Let's compare the yearly average temperatures across 4 predicted clusters.

Завдання

Calculate the yearly average temperatures across each cluster. The structure of data is shown below. [object Object]

Follow the next steps:

  1. Create a KMedoids model with 4 clusters named model.
  2. Fit the 3-15 (these are positions, not indices) columns of data to model.
  3. Add the 'prediction' column to data with predicted by model labels.
  4. Group the data DataFrame by the prediction column, then apply the .mean() function twice: the first call will calculate the monthly means, the second one (with axis = 1) will calculate the yearly averages.

Завдання

Calculate the yearly average temperatures across each cluster. The structure of data is shown below. [object Object]

Follow the next steps:

  1. Create a KMedoids model with 4 clusters named model.
  2. Fit the 3-15 (these are positions, not indices) columns of data to model.
  3. Add the 'prediction' column to data with predicted by model labels.
  4. Group the data DataFrame by the prediction column, then apply the .mean() function twice: the first call will calculate the monthly means, the second one (with axis = 1) will calculate the yearly averages.

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

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

The last chart we got was even harder to interpret than two chapters ago. But if we are talking about 'peeks', the number 4 best fits it.

Let's compare the yearly average temperatures across 4 predicted clusters.

Завдання

Calculate the yearly average temperatures across each cluster. The structure of data is shown below. [object Object]

Follow the next steps:

  1. Create a KMedoids model with 4 clusters named model.
  2. Fit the 3-15 (these are positions, not indices) columns of data to model.
  3. Add the 'prediction' column to data with predicted by model labels.
  4. Group the data DataFrame by the prediction column, then apply the .mean() function twice: the first call will calculate the monthly means, the second one (with axis = 1) will calculate the yearly averages.

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