icon

Usetutoringspotscode to get 8% OFF on your first order!

You have recently collected reviews from four movie reviewers where the reviewers are numbered 0-3. ………..

You have recently collected reviews from four movie reviewers where the reviewers are numbered 0-3. Each reviewer has rated six movies where the movies are numbered 0-5. The ratings range from 1 (terrible) to 5 (excellent). Note: To store the data in a 2D array the movie ID%u2019s must be mapped to 0-5. The reviews are shown in the following table:

0 1 2 3 4 5

0 3 1 5 2 1 5

1 4 2 1 4 2 4

2 3 1 2 4 4 1

3 5 1 4 2 4 2

Write a program that reads these values in from the file provided and stores them in a 2-d array. Based on this information your program should allow the user to enter ratings for any three movies.

The program should then find the reviewer whose ratings most closely match the ratings input by the user. It should then predict the user’s interest in the other movies by outputting the rating by the reviewer for the movies that were not rated by the user.

Use the Cartesian distance as the metric to determine how close the reviewer’s movieratings are to the ratings input by the user.

For example, if the user inputs a rating of 5 for movie 2, 2 for movie 4, and 5 for movie 5, then the closest match is reviewer with a distance of: sqrt((5-5)^2+(2-1)^2+(5-5)^2)

The program would then predict a rating of 3 for movie 0, a rating of 1 for movie 1, and a rating of 2 for movie 3.

The file is in txt. with the 24 numbers.

3 1 5 2 1 5 4 2 1 4 2 4 3 1 2 4 4 1 5 1 4 2 4 2

 

You can leave a response, or trackback from your own site.

Leave a Reply

Powered by WordPress | Designed by: Premium WordPress Themes | Thanks to Themes Gallery, Bromoney and Wordpress Themes