Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Description

This assignment will provide you with practice using arrays.

Your job is to build a simple Recommender System, similar to the one that Netflix (an online movie-rental service) 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.

On Oct. 2, 2006, Netflix announced a challenge to programmers everywhere to come up with a better way of figuring out how to predict what movies to recommend to users. They offered a prize of $1 million to anyone who could beat their own technique by 10% in prediction accuracy. A team of programmers eventually claimed the prize in 2009. You can read about the challenge on Wikipedia, or on Netflix's own page about it. This assignment is a simplified version of the kinds of recommendation techniques used by Netflix, Amazon, and others.

Helper code: The MovieFileHelper class

For this assignment, you will need the class MovieFileHelper. The code is available here. This class includes two methods that you will need to use for your assignment, but YOU DO NOT NEED TO UNDERSTAND HOW THEY WORK. The code for these methods involve several things you have not learned yet. Feel free to look at them and try to understand them, but it is not necessary to understand their code to do this assignment.

You will also need to download these two files, movies.txt and ratings.txt. The first one stores the names of 20 Hollywood movies. The second one stores movie ratings from 30 (fictional) users, who rated these 20 movies between 0 and 5 (5 being the best), or -1 if they haven't seen it.

The first method that is useful to you in MovieFileHelper is loadMovieNames(String filename). When you call this method with the String "movies.txt", it will load all of the movie names from that file into an array of Strings, and return that array.

The second method for you to use in MovieFileHelper is loadRatings(String filename). When you call this method with the String "ratings.txt", it will load all of the recommendations from that file into a 2-D array of doubles, and return that array.

Your Task

Create a Java file called Recommender.java. Your program should behave as follows:

• Using the helper class and text files described above, load the 20 movie names and the movie ratings from 30 people into two arrays in memory.

• Ask the user to enter a rating (between 1 and 5, or -1 if they haven't seen it) for each movie.

• Create a method that determines a score for each of the 30 people, which represents how similar that person's tastes are to the current user's tastes. Store these similarity scores in an array of 30 doubles. The similarity scores should be between 0 and 1 each.

• Create an array that represents recommended ratings for the user. There should be 20 numbers in this array, one for each movie. The number for each movie should be the average over all 30 ratings for the movie that are greater than 0 (only include ratings for users who have actually seen the movie). However, it should be a weighted average: people who are more similar to the current user should have a higher weight than people who are less similar.

• Display the names of the top-3 ranked movies (according to the recommended ratings from the previous step) that the user has not seen yet.

Suggestions and hints

Don't try to program everything all at once. Do it in parts, by writing some methods that accomplish part of the whole assignment. Write some println commands that show what's going on in memory after you call a method that you've just written, and run your program to make sure that the new method is working correctly. Repeat this for each new method you write.

You can come up with your own way of judging how similar 2 people's ratings are. One suggestion is to compute what's called "cosine similarity":

• for person 1, compute the square of each movie rating for movies they have seen, and add these up and then take the square root. Store the result in a variable called p1. For example, if person 1 saw 3 movies and rated them 4, 4, and 2, then p1 = sqrt(4*4 + 4*4 + 2*2) = sqrt(36) = 6.

• do the same for person 2, and store the result in a variable called p2.

• for each movie that both people have seen, compute the product of their ratings. Add up all of these products, and store the result in a variable called both. For example, if person 1 and person 2 both saw movies 7 and 14 (out of 20), and person 1 rated them as 4 for movie 7 and 2 for 14, and person 2 rated them as 2 for movie 7 and 3 for movie 14, then both = 4*2 + 2*3.

• The cosine similarity score between person 1 and person 2 is (both / (p1 * p2)).

The mathematical formula for a weighted average, where there are N numbers stored in an array called a, and N corresponding weights stored in an array called w, goes like this:

weighted_average(N, a, w) = (a1*w1 + a2*w2 + ... + aN*wN) / (w1 + ... + wN)

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92072355
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Start by assigning to variable answers a list containing an

Start by assigning to variable answers a list containing an arbitrary sequence of strings 'Y' and 'N'. For example: answers= ['Y','N','N','Y','N','Y','Y','Y','N','N','N'] Write Python statements corresponding to the foll ...

Discuss the criteria necessary to establish a factor as a

Discuss the criteria necessary to establish a factor as a confounder and provide an example applying these criteria?

A chemistry student needsnbsp150 ml of acetone for an

A chemistry student needs 15.0 mL of acetone for an experiment. By consulting the  CRC Handbook of Chemistry and Physics , the student discovers that the density of acetone is 0.790 g.cm^-3. Calculate the mass of acetone ...

You are running a small manufacturing shop with plenty of

You are running a small manufacturing shop with plenty of workers but with a single milling machine. You have to produce n items; item i requires m i machining time first and then p i polishing time by hand. The machine ...

What are the best practices to follow for microsoft windows

What are the best practices to follow for Microsoft Windows network security. Which two would you start with and why?

Ellen is an anthropologist who has been working at olduvai

Ellen is an anthropologist who has been working at Olduvai Gorge in Tanzania for the past six months. She has been conducting research on the Internet. She finds a Web site with an article that proposes a revolutionary t ...

Suppose a bowl has 5 chips 2 chips labeled 2 and 3 chips

Suppose a bowl has 5 chips; 2 chips labeled "2" and 3 chips labeled "3". Suppose 2 chips are selected at random without replacement. Let random variable X equal the product of the two draws (e.g. if the first draw is a 2 ...

1 under what circumstances is it advantageous for a company

1. Under what circumstances is it advantageous for a company competing in foreign markets to concentrate its value chain activities in a select few locations? Under what circumstances is it advantageous for a company com ...

Iq test scores of students are normally distributed with

IQ test scores of students are normally distributed with mean μ=100 and standard deviation σ=10. What is the 33th percentile of the IQ scores? For a randomly chosen student, what is the probability that his or her IQ sco ...

Write a program in java to satisfy the following create a

Write a program in Java to satisfy the following : Create a class to store information on Network infrastructure assets. Network Infrastructure Asset may include PCs, Monitors, Switches, Routers, Cables, Access Points et ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As