You have collected reviews from four movie reviewers where the reviewers are numbered 0-3. Each reviewer has rated six movies where the movies are numbered 100- 105. The ratings range from 1 (terrible) to 5 (excellent). The reviews are shown in the following table: 100 101 102 103 104 105 3 5 2 1 5 1 4 2 4 2 4 3 1 2 4 4 1 3 5 1 4 4 2

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

please use c++ to answer the following question

You have collected reviews from four movie reviewers where the reviewers are
numbered 0-3. Each reviewer has rated six movies where the movies are numbered 100-
105. The ratings range from 1 (terrible) to 5 (excellent).
The reviews are shown in the following table:
100
101
102
103
104
105
3
1
5
2
1
5
4
2
1
4
2
4
2
3
1
2
4
4
1
3
5
1
4
2
4
2
Write a class that stores this data using a 2D array. Based on this information your
class' member predictRating 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 ratings 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 movie ratings are to the ratings input by the
user. This technique is a simple version of the nearest neighbor classification algorithm.
For example, if the user inputs a rating of 5 for movie 102, 2 for movie 104, and 5 for
movie 105, then the closest match is reviewer 0 with a distance of sqrt ( (5-5) ^2 + (2-
1) ^2 + (5-5) ^2) = 1. The program would then predict a rating of 3 for movie 100, a
rating of 1 for movie 101, and a rating of 2 for movie 103.
Note: User the STL Array/vector to create a 2D array/vector. To store the data in a 2D array the movie ID's must be mapped to 0-5. Store -1 to
represent unrated movies.
Transcribed Image Text:You have collected reviews from four movie reviewers where the reviewers are numbered 0-3. Each reviewer has rated six movies where the movies are numbered 100- 105. The ratings range from 1 (terrible) to 5 (excellent). The reviews are shown in the following table: 100 101 102 103 104 105 3 1 5 2 1 5 4 2 1 4 2 4 2 3 1 2 4 4 1 3 5 1 4 2 4 2 Write a class that stores this data using a 2D array. Based on this information your class' member predictRating 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 ratings 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 movie ratings are to the ratings input by the user. This technique is a simple version of the nearest neighbor classification algorithm. For example, if the user inputs a rating of 5 for movie 102, 2 for movie 104, and 5 for movie 105, then the closest match is reviewer 0 with a distance of sqrt ( (5-5) ^2 + (2- 1) ^2 + (5-5) ^2) = 1. The program would then predict a rating of 3 for movie 100, a rating of 1 for movie 101, and a rating of 2 for movie 103. Note: User the STL Array/vector to create a 2D array/vector. To store the data in a 2D array the movie ID's must be mapped to 0-5. Store -1 to represent unrated movies.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Introduction to Coding
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education