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

Binary model performance

You've already built several ALS models, so we won't do that again. An implicit ALS model has already been fitted to the binary ratings of the MovieLens dataset. Let's look at the binary_test_predictions from this model to see what we can learn.

The ROEM() function has been defined for you. Feel free to run help(ROEM) in the console if you want more details on how to execute it!

Bu egzersiz

Building Recommendation Engines with PySpark

kursunun bir parçasıdır
Kursu Görüntüle

Egzersiz talimatları

  • Import the col function from the pyspark.sql.functions class.
  • Take a look at binary_test_predictions using the .show() method to get an understanding of what the data looks like.
  • Call ROEM() on the binary_test_predictions to evaluate the model's performance. Do you think it performed well?
  • Use .filter() to look only at user 42's predictions (col("userId") == 42). Do you notice anything?

Uygulamalı interaktif egzersiz

Bu örnek kodu tamamlayarak bu egzersizi bitirin.

# Import the col function
from ____.sql.____ import ____

# Look at the test predictions
____.____()

# Evaluate ROEM on test predictions
____(____)

# Look at user 42's test predictions
binary_test_predictions.____(col("____") == ____).show()
Kodu Düzenle ve Çalıştır