Relative importance का हीटमैप प्लॉट करें
बहुत बढ़िया! अब आप प्रत्येक क्लस्टर के लिए relative scores को विज़ुअलाइज़ करने वाला एक हीटमैप बनाएँगे.
हमने relative importance scores को relative_imp के रूप में लोड किया है. seaborn लाइब्रेरी sns नाम से लोड है और matplotlib का pyplot मॉड्यूल plt के रूप में उपलब्ध है.
यह अभ्यास पाठ्यक्रम का हिस्सा है
Python में Customer Segmentation
अभ्यास निर्देश
- 8 बाय 2 इंच के फ़िगर साइज के साथ एक प्लॉट इनिशियलाइज़ करें.
- प्लॉट का शीर्षक जोड़ें.
relative_impडेटा पर हीटमैप प्लॉट करें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# 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()