Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Mining Big Data Assignment: Basics and Map-Reduce

Exercise 1 - Suspected Pairs

Using the information from the first lecture (or Section 1.2.3 in the textbook), what would be the number of suspected pairs if the following changes were made to the data (all changes should be applied at once).

1. The number of days of observation was raised to 5000.

2. The number of people observed was raised to 5 billion (and there were therefore 500,000 hotels).

3. We only reported a pair as suspect if they were at the same hotel at the same time on four different days.

Exercise 2 - Hadoop

For this exercise, you have to set up and configure your system to use Hadoop. Follow the instructions in Stanford document (in attached file) and set up the virtual machine as described in Section 1. Run the example program of Section 2 and carry out the different steps given in that section.

  • Write your own Hadoop Map-Reduce job that outputs the number of words that start with each letter (see Sections 2.5 and 3 of the Stanford document).
  • Run your job on the file in standalone mode and pseudo-distributed mode and record the output.

Exercise 3 - Friend Recommendation System (Stanford)

Write a MapReduce program in Hadoop that implements a simple People You Might Know social network friendship recommendation algorithm. The key idea is that if two people have a lot of mutual friends, then the system should recommend that they connect with each other. You have to run the program on the system setup in Exercise 2 in order to receive points for this exercise.

Input: Download the input file, the input file contains the adjacency list and has multiple lines in the following format:

Here, is a unique integer ID corresponding to a unique user and is a comma separated list of unique IDs corresponding to the friends of the user with the unique ID . Note that the friendships are mutual (i.e., edges are undirected): if A is friend with B then B is also friend with A. Algorithm: Let us use a simple algorithm such that, for each user U, the algorithm recommends N = 10 users who are not already friends with U, but have the most number of mutual friends in common with U.

Output: The output should contain one line per user in the following format:

where is a unique ID corresponding to a user and is a comma separated list of unique IDs corresponding to the algorithms recommendation of people that might know, ordered in decreasing number of mutual friends. Even if a user has less than 10 second-degree friends, output all of them in decreasing order of the number of mutual friends. If there are recommended users with the same number of mutual friends, then output those user IDs in numerically ascending order. Also, please provide a description of how you are going to use MapReduce jobs to solve this problem. Do not write more than 3 to 4 sentences for this: we only want a very high-level description of your strategy to tackle this problem. Note: It is possible to solve this question with a single MapReduce job. But if your solution requires multiple map reduce jobs, then that is fine too.

For your submission

  • Include your source code
  • Include in your writeup a short paragraph describing your algorithm to tackle this problem.
  • Include in your writeup the recommendations for the users with following user IDs: 924, 8941, 8942, 9019, 9020, 9021, 9022, 9990, 9992, 9993.

Exercise 4 - MapReduce

This exercise has 4 parts. In this exercise, you will be writing and implementing two MapReduce programs. Both are a bit challenging, but they will help you to have a better understanding about the MapReduce implementation. After you write the programs, you will need to answer some questions about them.

Remember that neither problem is case sensitive, so transform words to lowercase or uppercase. Also remember to use the StringTokenizer to find the correct answers.

Part 1: Write a program that processes the FirstInputFile and the SecondInputFile (attached). This program should count the number of words with a specific amount of letters in these files - for example, the number of words with 4 letters, 5 letters and so on. If one word is repeated 20 times in the text, count it individually 20 times.

Part 2: Answer Questions 1-6.

Q1: How many words are there with length 10 in FirstInputFile?

Q2: How many words are there with length 4 in FirstInputFile?

Q3: What is the longest length between words and what is its frequency in FirstInputFile?

Q4: How many words are there with length 2 in SecondInputFile?

Q5: How many words are there with length 5 in SecondInputFile?

Q6: What is the most frequent length and what is its frequency in SecondInputFile?

Part 3: Write a second program that again processes the FirstInputFile (attached) and the SecondInputFile (attached). However, in addition to counting the number of words with a specific amount of letters, if one word is repeated several times, count it only once. So, your output should be the frequency of words with same length, but count a repeated word only once. Note: You may need to use 2 MapReduce jobs.

Part 4: Answer Questions 7-12.

Q7: How many words are there with length 10 in FirstInputFile?

Q8: How many words are there with length 4 in FirstInputFile?

Q9: What is the most frequent length and what is its frequency in FirstInputFile?

Q10: How many words are there with length 5 in SecondInputFile?

Q11: How many words are there with length 2 in SecondInputFile?

Q12: What is the second-most frequent length and what is its frequency in SecondInputFile?

Exercise 5 - Summary of 2.4 and 2.5

For this exercise you have to read Section 2.3.9-2.3.11, 2.4, and 2.5 in Leskovec, Rajaraman, Ullman (second edition, 2014).

  • Summarize the content of 2.4 in your own words (600 words).
  • Summarize the content of 2.5 in your own words (600 words).

Attachment:- Assignment File.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92749381

Have any Question?


Related Questions in Computer Engineering

A standard 52 card playing deck assigns a unique

A standard 52 card playing deck assigns a unique combination of 13 ranks (2,3,4,5,6,7,8,9,10,J,Q,K,A) and 4 suits (Clubs, Diamonds, Hearts, Spades) to each card (13  4 = 52). Suppose 5 cards are selected at random. Deriv ...

Babies weighing less than 55 pounds at birth are considered

Babies weighing less than 5.5 pounds at birth are considered "low-birth-weight babies." In the United States, 7.6% of newborns are low-birth-weight babies. The following information was accumulated from samples of new bi ...

Suppose you are given a six-sided die that might be biased

Suppose you are given a six-sided die, that might be biased in an unknown way. Explain how to use die rolls to generate unbiased coin flips, and determine the expected number of die rolls until a coin flip is generated. ...

The national sporting goods association nsga conducted a

The National Sporting Goods Association (NSGA) conducted a survey of the ages of individuals that purchased skateboarding footwear. The ages of this survey are summarized in the following relative frequency distribution. ...

Question suppose your system is designed in such a way that

Question : Suppose your system is designed in such a way that your computer needs to wait for some while to check if the channel is clear before transmitting. You take your measurement overtime and you come to find out t ...

A compute the sumnbsps1nbsp 1 2 3 nbsp nbsp 9999 the sum

(a) Compute the sum S1 = 1 + 2 + 3 + . . . + 9999 (the sum of all integers from 1 to 9999). Do not use a program. (b) Compute the sum S2 = 1+3+5+...+9999 (the sum of all odd integers from 1 to 9999). Do not use a program ...

Question you need to research the topic and discuss the

Question: You need to research the topic and discuss the topic in at least 400-500 words with references. A post without a reference will not count as a discussion. What is text mining and what is the purpose of it? Give ...

Question what steps should be taken to detect alleged

Question : What steps should be taken to detect alleged industrial/cyberespionage? Discuss the implications of each of the steps proposed.

A survey of 200 students is selected randomly on a large

A survey of 200 students is selected randomly on a large university campus. They are asked if they use a laptop in class to take notes. The results of the survey is that 70 of the 200 students responded yes. Calculate th ...

Need help with a java program that takes two arrays a and b

Need help with a Java program that takes two arrays a and b of length 5 storing int values, and returns the dot product of a and b. That is, it returns an array c of length n such that c[i]=a[i]*b[i].

  • 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