Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Your job is to build a simple Recommender System ( IN JAVA) , similar to the one that Netflix uses to recommend movies to customers.

Your job is to build a simple Recommender System (IN JAVA), similar to the one that Netflix uses to recommend movies to customers. The basic idea is to find out some movies that a user likes, and then recommend other movies that the user might also like.

Tasks

Task 1: Load the 20 movie names and the movie ratings from 30 people into two arrays in memory. These can be read by your program using the Scanner class. You are not required to handle FileNotFoundException. You need to write a method named "loadData" that stores the movie names in a array and the loads the ratings of the movies in a 2-dimensional array.

public static void loadData( String moviesFileName, String ratingsFileName, int [] movies , int [] [] movieRatings)

Task 2: Ask the user to enter 20 rating (between 1 and 5, or -1 if they haven't seen it) for each movie. Store the user ratings in an array.

Task 3: Create a method named "calculateScroes" that determines for each of the 30 people a score, which represents how similar that person's tastes are to the taste of the user of the program. Store these similarity scores in an array of 30 doubles. The similarity scores should be between 0 and 1 each. Where 0 means no similarity and 1 means exactly same. The "calculateSimilarityScroes" method should look like below:

public static double[] calculateSimilarityScroes( int [] userRating, int[][] movieRatings)

Some Hints:

A very naive way to calculate the similarity score for a person is to calculate the average of the ratings given by that person. And then normalize the rating, such that it is in the given range ( between 0 and 1). For example: if a person's given ratings on four movies are like below:

5, -1, 3, 4

Then the similarity rating of that person will become:

image text in transcribedsimilarityScoreraw=(5+(?1)+3+4)4=114=2.75

image text in transcribedsimilarityScorenormalized=|2.75|5=0.55

Note: 5 is the highest value we can get here, so if we divide by five the value will be always in between 0 and 1.

For more accurate results you can also use some good techniques like Euclidean distance or Cosine similarity.

The list of movies...must be read as a file

Airplane

Alien

Bridesmaids

Cloudy with a Chance of Meatballs

Exorcist

Fantastic Mr. Fox

Forrest Gump

Hangover

Harold and Kumar Go to White Castle

The Help

Incredibles

Jaws

Monsters, Inc

Psycho

Raiders of the Lost Ark

Silver Linings Playbook

Titanic

Twilight Eclipse

Up

Zoolander

The movie ratings-- must be read as a file

- 1 2 3 5 -1 5 3 3 1 4 2 2 5 -1 1 3 3 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 -1 2 2 2 5 -1 3 4 -1 -1 2 -1 2

1. 4 3 -1 3 2 1 -1 -1 -1 1 3 1 3 3 1 -1 -1 -1 3

4 3 3 -1 4 2 -1 4 -1 -1 2 4 -1 3 4 2 -1 -1 -1 4

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

- 1 4 2 1 5 -1 -1 2 1 1 -1 5 -1 5 4 1 2 2 -1 1

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

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

12.75 similarityScorerau

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions

Question

Maintain five-figure accuracy

Answered: 1 week ago