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

Ratings data types

Markus watches a lot of movies, including documentaries, superhero movies, classics, and dramas. Drawing on your previous experience with Spark, use the markus_ratings dataframe, which contains data on the number of times Markus has seen movies in various genres, and think about whether these are implicit or explicit ratings. Use the groupBy() method to determine which genre has the highest rating, which could likely influence what recommendations ALS would generate for Markus.

Bu egzersiz, kursun bir parçasıdır

Building Recommendation Engines with PySpark

Kursa Göz Atın

Egzersiz talimatları

  • Use the groupBy() method to group the markus_ratings dataframe by "Genre".
  • Apply the .sum() method to get the total number of movies watched for each genre.
  • Be sure to add the .show() method at the end to view the counts.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Group the data by "Genre"
markus_ratings.____("____").____().____()
Kodu Düzenle ve Çalıştır