Question: In python please In python please CMPE 150 Fall 2021 Project 2: Movie Recommender In this project, you will implement a movie recommendation system. The

In python please

In python please In python please CMPE 150 Fall 2021 Project 2:Movie Recommender In this project, you will implement a movie recommendation system.The system will make recommendations for a user based on ratings of

In python please

CMPE 150 Fall 2021 Project 2: Movie Recommender In this project, you will implement a movie recommendation system. The system will make recommendations for a user based on ratings of other users. You are given a file named ratings.csv containing movie rating history for a set of users. Each line of this file corresponds to the history of a user and includes user id and information of movies rated by this user separated by commas (). For each movie, its name and rating are given and this pair is separated by a column (:). For instance, the line Userx, Toy Story:5, Up:5, Inside Out:4 indicates that this user has id UserX and watched three movies: Toy Story , Up, Inside Out and gave ratings of 5, 5, 4 respectively. To make recommendations, the system will consider the similarity of user movie ratings and suggest movies from history of users with most "similar" tastes. The taste similarity of users will be computed as 1 over the sum of absolute difference between ratings of these users. If a movie has been rated by one user but not the other one, then the mean rating of the movie is considered as the rating of the user that has not rated yet. Sample Dataset Consider the sample dataset containing only four users with the following rating histories: UserA, Toy Story:5, Up:5, Inside Out:4 UserB, Toy Story:2, Wall-E:5 Userc, Toy Story:5, Inside Out:5,Zootopia:4 UserD, Zootopia:1 Mean Rating Mean rating of a movie is calculated as the sum of ratings divided by the number of users that rated the particular movie. Then, the mean ratings of movies in the sample set will be as follows: Movie Mean Rating Toy Story 4.0 Up 5.0 Inside Out 4.5 Wall-E 5.0 Zootopia 2.5 User Similarity The taste similarity of users is calculated as 1 over the sum of absolute difference between ratings of these users. The similarities of users in the sample set are given below: Pair Similarity UserA-UserB 1/3.5 UserA-User 1/2.5 UserA-UserD 1/3.0 UserB-UserC 1/5.0 UserB-UserD 1/3.5 UserC-UserD 1/4.5 Explanation for UserA-UserB: The movies rated by either UserA or UserB: Toy Story, Up, Inside Out, Wall-E. The rating differences for these movies are Toy Story: 5 - 2 = 3 Up: 5 - 5 (mean rating) = 0 Inside Out: 4 - 4.5 (mean rating) = -0.5 Wall-E: 5 (mean rating) - 5 = 0 The sum of absolute values are 3.5. So, the similarity is 1/3.5. Recommendations The recommender will take a user id and the number of similar users (N) as inputs, and then, find N most similar users to given user and suggests movies that such users have rated highly (.e. the rating is greater than or equal to 3) but not yet being rated by the given user. If a movie has been rated by more than one most similar user, then the rating by each user must be greater than or equal to 3 for this movie to be recommended. For the input UserD, 2 in the sample set, the recommender system will suggest Inside Out , Up and Wall-E since the most similar users are UserA and UserB , and the ratings of these movies are greater than 3. Note that Toy Story is not suggested since its rating by Users is 2. You are given the main program which takes a user_id and the number of similar users N, and calls a set of functions to make recommendations. You are supposed to complete these functions. You are allowed and encouraged to write and use additional functions. However, YOU ARE NOT ALLOWED TO CHANGE THE MAIN PROGRAM. Please note that importing libraries is not allowed. To compute absolute value, you can use the given function abs(). Examples Input Output User 10,1 Taxi Driver, Total Recall User50,1 Mamma Mia!, The Mask of Zorro, The Prestige User200,2 The Untouchables User450,3 Con Air, The Mask of Zorro The most similar users for the inputs above are given in the below table: Input User Most Similar Users User 10 User412 User50 User286 User200 User895, User461 User450 User232, User 169, User960 Mean ratings for a set of movies can be found below: Movie Mean Rating Total Recall 3.075 The Mask of Zorro 3.026315789473684 Con Air 2.782608695652174 The Prestige 2.826923076923077 Message in a Bottle 2.8333333333333335 Troy 3.1777777777777776

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!