BaşlayınÜcretsiz Başlayın

Visualize clusters with seaborn

Let us now visualize the footfall dataset from Comic Con using the seaborn module. Visualizing clusters using seaborn is easier with the inbuild hue function for cluster labels.

The data is stored in a pandas DataFrame, comic_con. x_scaled and y_scaled are the column names of the standardized X and Y coordinates of people at a given point in time. cluster_labels has the cluster labels. A linkage object is stored in the variable distance_matrix.

Bu egzersiz

Cluster Analysis in Python

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import the seaborn module as sns.
  • Plot a scatter plot using the .scatterplot() method of seaborn, with the cluster labels as the hue argument.

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import the seaborn module
____

# Plot a scatter plot using seaborn
sns.scatterplot(x=____, 
                y=____, 
                ____=____, 
                data = comic_con)
plt.show()
Kodu Düzenle ve Çalıştır