เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Limited data in your rows

This data sparsity can cause an issue when using techniques like K-nearest neighbors as discussed in the last chapter. KNN needs to find the k most similar users that have rated an item, but if only less than or equal to k users have given an item the rating, all ratings will be the "most similar".

In this exercise, you will count how often each movie in the user_ratings_df DataFrame has been given a rating, and then see how many have only one or two ratings.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Building Recommendation Engines in Python

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Count the occupied cells per column
occupied_count = user_ratings_df.____().____()
print(occupied_count)
แก้ไขและรันโค้ด