Session Ready
Exercise

Recalculating the matrix

Now that you have your three factor matrices, you can multiply them back together to get complete ratings data without missing values. In this exercise, you will use numpy's dot product function to multiply U and sigma first, then the result by Vt. You will then be able add the average ratings for each row to find your final ratings.

U, sigma, Vt, avg_ratings, and user_ratings_df from the previous exercise have been loaded for you. Also, numpy has been loaded as np.

Instructions 1/4
undefined XP
  • 1
    • Find the dot product of the matrix U and sigma.
    • 2
      • Find the dot product of U_sigma and Vt and print the result.
    • 3
      • Reshape the values of avg_ratings and add them back onto U_sigma_Vt.
    • 4
      • Create a DataFrame of the results using the original index and column names from user_ratings_df.