logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

In this assignment, you’ll be using a technique called collaborative filtering to recommend movies to users, similar to how Netflix makes movie recommendations.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Objectives

To teach students about collaborative and content filtering.

Overview

In this assignment, you’ll be using a technique called collaborative filtering to recommend movies to users, similar to how Netflix makes movie recommendations.

Recommender Systems

A recommender system is a program that recommends products—ranging from movies to books to clothing to news articles to search queries—to users. Prominent examples of companies that use recommender systems are Spotify, to find your songs like the songs you often listen to, and Amazon, to find your books (and many other products!) that you might like.

Netflix is famous for the efforts they spent developing and refining their recommender system. From 2006 to 2009, Netflix “crowdsourced” an algorithm to boost their sales and improve customer satisfaction. What this means is that they invited anyone (without any connection to Netflix) to submit code that would predict user ratings for movies, and they offered a large monetary prize

 

($1 million!), to any team that could best Netflix’s own algorithm by more than 10%. It was a high bar, but BellKor’s Pragmatic Chaos team succeeded.

Most recommendation systems follow one of two models: either collaborative filtering or content filtering. Collaborative ftltering collects a large amount of user data—behavior, preferences, etc.—and analyzes it, predicting what users will like based on the behavior of other similar users. Content ftltering, on the other hand, assigns keywords or descriptive tags to items, and then recommends items to users based on item similarity.

Netflix is actually a hybrid recommender system: it uses both collaborative filtering and content filtering. It can first use collaborative filtering to determine that Anna and Erin have similar taste in movies. Then, through content filtering, it can discover that “Toy Story,” which both of them liked, is categorized under the same set of genres as “Inside Out,” which neither of them has seen. If it then goes on to recommend “Inside Out” to both of them and they both love it, everyone wins.

Data

The “ratings.csv” file found here contains users’ ratings of movies.

Collaborative Filtering

Your goal in this problem is to create a similarity matrix between movies, based not on their content (e.g., genres) as in Part 1, but instead based on their user ratings.

To do so, load “ratings.csv” into an R data frame, say ratings. This file is  very large, so we recommend truncating your ratings data frame. You set a hard limit using ratings <- head(ratings, n) for some value of n as large as your computer can accommodate (e.g., 4000). Or, you can set a limit based on “userId”: e.g., ratings <- ratings > filter(userId < 20). In either case, the larger your data frame, the better your recommendations will be, but the slower your code will run.

From the truncated ratings data frame, create a matrix with users as rows, and movies as columns. Call it mat. The entries in this matrix should be mostly 0s, since most users have not seen most movies. But if the user has rated a movie, the entry in the matrix corresponding to a user (row) and movie (column) should be the user’s rating of that movie.

After creating this ratings matrix, you can then use the cosine function in the lsa package to create a similarity matrix based on cosine similarity as follows: cosine(mat). Note that the cosine function calculates similarities among columns in a matrix, not rows.

The similarity matrix is not that informative without the movie titles, so set the row and column names to be the movie titles. Hint: Use the match function to

 

 

find the indices of ratings$movieId in movies$movieId.

Use the View command to view the similarity matrix. Clicking on a column sorts the data by that column, and clicking twice sorts the data by that column in descending order. Click on three columns of your choice, and for each, report the five movies that are most similarly rated by users. Do you agree with these recommendations?

(5/5)
Attachments:

Expert's Answer

820 Times Downloaded

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

820 Times Downloaded

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

936 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

629 Answers

Hire Me
expert
Husnain SaeedComputer science

1000 Answers

Hire Me
expert
Atharva PatilComputer science

864 Answers

Hire Me
April
January
February
March
April
May
June
July
August
September
October
November
December
2025
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
SunMonTueWedThuFriSat
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30