LoslegenKostenlos loslegen

Plot relative importance heatmap

Great job! Now you will build a heatmap visualizing the relative scores for each cluster.

We have loaded the relative importance scores as relative_imp. The seaborn library is loaded as sns and the pyplot module from matplotlib is available as plt.

Diese Übung ist Teil des Kurses

Customer Segmentation in Python

Kurs anzeigen

Anleitung zur Übung

  • Initialize a plot with a figure size of 8 by 2 inches.
  • Add the plot title.
  • Plot the heatmap on relative_imp data.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Initialize a plot with a figure size of 8 by 2 inches 
plt.____(____=(____, ____))

# Add the plot title
plt.____('Relative importance of attributes')

# Plot the heatmap
sns.____(data=____, annot=True, ____='.2f', ____='RdYlGn')
plt.show()
Code bearbeiten und ausführen