Question: Write Scala code on Sparks community edition for solving the following problems. Use the hints given with each problem to guide your solution development. P.S.

Write Scala code on Sparks community edition for solving the following problems. Use the hints given with each problem to guide your solution development.

P.S. If you are not comfortable with writing Scala code, you can use Python or Java. However, I strongly recommend that you at least first try to write the code in Scala.

(10 points) Write a function that computes the Simple Matching Coefficient Similarity metric.

The function should take two arrays or two vectors that hold binary values. It computes the similarity and returns the results.

(10 points) Write a function that computes the Jaccard Coefficient Similarity metric.

Similar to the previous problem, the function should take two arrays or two vectors that hold binary values. It computes the similarity and returns the results.

(30 points) Write a piece of code that reads a data file of the form:

, , < movie_2> , < movie_3> then computes the pair-wise similarities between each two data points (users). Pairwise similarities mean that you will compute the similarity between each two users in the dataset. If you have 4 users, then you should compute (4*4=16) similarities. If you have 6 users, then you will compute (6*6=36) similarities. You can ignore the fact that half of the compute similarities are duplicates.

The movies are represented using binary values, with 1 indicating that the user has watched the movie, and 0 indicating that the user has not watched the movie. Use the file attached to this assignment to test your code.

******Please provide screen shots of results from code*******

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!