MSD सार-सांख्यिकी
आइए Million Songs Echo Nest Taste Profile डेटा सबसेट से परिचित हों। इस कोर्स में सरलता के लिए हम इसे Million Songs डेटासेट या msd ही कहेंगे। आइए users की संख्या और songs की संख्या निकालें। साथ ही देखें कि इस सबसेट में किन songs के सबसे ज़्यादा plays हैं।
यह अभ्यास पाठ्यक्रम का हिस्सा है
PySpark के साथ Recommendation Engines बनाना
अभ्यास निर्देश
- डेटा कैसा दिखता है, यह देखने के लिए
.show()मेथड का उपयोग करें. - distinct
userIds गिनने के लिए कोड पूरा करें।userIdकॉलम को select करें, फिर.distinct()और.count()कॉल करें. - अब यही काम
songIds के लिए करें, यानी distinctsongIds की गिनती निकालें।songIdकॉलम select करें और उस पर.distinct()और.count()कॉल करें.
इंटरैक्टिव व्यावहारिक अभ्यास
इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।
# Look at the data
msd.____()
# Count the number of distinct userIds
user_count = msd.select("____").____().count()
print("Number of users: ", user_count)
# Count the number of distinct songIds
song_count = msd.select("____").____().count()
print("Number of songs: ", song_count)