Spooky Sale: 10% off Premium yearly · $118.80 for the first year · until Nov 6Get it

Deep-ML
Learn
Problems1,200+ hands-on ML problemsLearning PathA guided route through the fundamentalsLabsInteractive labs on real techniquesProjectsBuild a GPT, an RL agent, CUDA kernelsCollectionsCurated problem sets and videosMathPen-and-paper math for MLIntuitionInvent the idea behind the formula yourselfPlaylistsYour own problem lists, shareableStudy AssistantAn AI teacher that knows your progress
Interview Prep
Compete
ContestsFresh problem sets, ranked liveLeaderboardWhere you stand, globallyBuddiesSolve with a friend: streaks, a weekly board, chat
Discuss
Deep-Path
Premium
      Intuition
      15 of 130

      Every user, every movie

      Now several people share the app. movies is the catalogue, one row per movie (how much of each genre it has), and tastes holds everyone’s taste, one column per person (how much they like each genre, in the same order). Write all_scores(movies, tastes): a table with one row per movie and one column per person, each cell how much that person will enjoy that movie.

      Three people now: each one’s taste is a column of the tastes table, each movie a row of the catalogue. Pairing the first movie with the first person and so on leaves most of them out. The goal is the whole table, one cell for every movie and every person, like the bars it ends on. Each cell is where a movie’s row and a person’s column cross.

      Each person’s taste is now a column on top. Each movie is a row, as before.tastesactionromancehorrorcomedyyou+2−10+1Sam−1+20+3Ana+10+3−1actionromancehorrorcomedyLaser Ninjas3001Paris, Again0301The Basement1030Ghost Prom0122
      Your functionall_scores(movies, tastes)
      moviesthe catalogue (a numpy array), one row per movie: how much of each genre it hase.g. [[3, 0, 0, 1], [0, 3, 0, 1], [1, 0, 3, 0],…
      tasteseveryone's tastes (a numpy array), one column per person: tastes[:, j] is how much person j likes each genree.g. [[2, −1, 1, 3], [−1, 2, 0, 1], [0, 0, 3, −…
      returnsa table: one row per movie, one column per person, each cell how much that person will enjoy that movie
      solution.pyLoading Python
      Sign in for an AI hint
      ← Score every movie at onceInvent the score →