Question

1. Spark uses a string to represent a vector. For example, (8,[1,4,5],[0.871,1.0,0.447]) is one such string....

1. Spark uses a string to represent a vector. For example, (8,[1,4,5],[0.871,1.0,0.447])

is one such string. Write out the full vector that the above string represents:

2. Very briefly, what is the main advantage of using such a sting representation for a vector?

3.

When using columnSimilarities() call on a RDD, the results coming back is a collection of MatrixEntry instances. One of the instance looks like the following,

MatrixEntry(109,385,0.032109)

very briefly, write out what does this entry mean.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOLUTION-

1. In Spark we've many forms of vectors to represent the string in

Given, (8, [1,4,5], [0.871, 1.0, 0.447])

In this It has a size of 8, [1,4,5] represent the indices, the rest represent the values which are non-zero

It means that the vector has

0.871 at 1st position

1.0 at 4th position

0.447 at 5th position

2. It's helpful in computation and storage management. Such a string is used to provide clear reference.

3. Given , MatrixEntry(109,385,0.032109)

The constructor MatrixEntry represents ith row and jth column and it's corresponding value of that entry

109 is row

385 is column

0.032109 is the value/entry

row and column are of type long

value is of type double

Hence this represents to enter that particular value in a matrix which is distributed at ijth position.

IF YOU HAVE ANY DOUBT PLEASE COMMENT DOWN BELOW I WILL SOLVE IT FOR YOU:)
----------------PLEASE RATE THE ANSWER-----------THANK YOU!!!!!!!!----------

Add a comment
Know the answer?
Add Answer to:
1. Spark uses a string to represent a vector. For example, (8,[1,4,5],[0.871,1.0,0.447]) is one such string....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • [Question 4, 8 points total, including 4.1 - 4.3] This question is about understanding data representation...

    [Question 4, 8 points total, including 4.1 - 4.3] This question is about understanding data representation and input/output in Spark. 4.1 (3 points) Spark uses a string to represent a vector. For example, (8. [1,4,5), 10.871,1.0,0.4471) is one such string. Write out the full vector that the above string represents: your answer: 4.2 (2 points) Very briefly, what is the main advantage of using such a sting representation for a vector? your answer: 4.3 (3 points) When using sedumasimilarities call...

  • [Question 4, 8 points total, including 4.1 - 4.3] This question is about understanding data representation...

    [Question 4, 8 points total, including 4.1 - 4.3] This question is about understanding data representation and input/output in Spark. 4.1 (3 points) Spark uses a string to represent a vector. For example, (8, [1,4,5), 10.871, 1.0, 0.447]) is one such string. Write out the full vector that the above string represents: your answer: 4.2 (2 points) Very briefly, what is the main advantage of using such a sting representation for a vector? your answer:

  • About Classes and OOP in C++ Part 1 Task 1: Create a class called Person, which...

    About Classes and OOP in C++ Part 1 Task 1: Create a class called Person, which has private data members for name, age, gender, and height. You MUST use this pointer when any of the member functions are using the member variables. Implement a constructor that initializes the strings with an empty string, characters with a null character and the numbers with zero. Create getters and setters for each member variable. Ensure that you identify correctly which member functions should...

  • JAVA :The following are descriptions of classes that you will create. Think of these as service...

    JAVA :The following are descriptions of classes that you will create. Think of these as service providers. They provide a service to who ever want to use them. You will also write a TestClass with a main() method that fully exercises the classes that you create. To exercise a class, make some instances of the class, and call the methods of the class using these objects. Paste in the output from the test program that demonstrates your classes’ functionality. Testing...

  • Example program #include <string> #include <iostream> #include <cmath> #include <vector> using namespace std; vector<int> factor(int n)...

    Example program #include <string> #include <iostream> #include <cmath> #include <vector> using namespace std; vector<int> factor(int n) {     vector <int> v1;     // Print the number of 2s that divide n     while (n%2 == 0)     {         printf("%d ", 2);         n = n/2;         v1.push_back(2);     }     // n must be odd at this point. So we can skip     // one element (Note i = i +2)     for (int i = 3; i <=...

  • In this assignment you will implement software for your local library. The user of the software...

    In this assignment you will implement software for your local library. The user of the software will be the librarian, who uses your program to issue library cards, check books out to patrons, check books back in, send out overdue notices, and open and close the library. class Calendar We need to deal with the passage of time, so we need to keep track of Java. Declare this variable as private int date within the class itself, not within any...

  • 3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa...

    3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa Give a leftmost derivation for the string. 3 points) (4 poiots) (5 points) (3 points) sECTION IWOLAttcmpt.any 3.(or 2) questions from this.scction Suppose we have two tokens: (1) the keyword if, and (2) id-entifiers, which are strings of letters other than if. Show the DFA for these tokens. Give a nightmost derivation for the string. Give a parse tree for the string i) Is...

  • C++ LAB 19 Construct functionality to create a simple ToDolist. Conceptually the ToDo list uses a...

    C++ LAB 19 Construct functionality to create a simple ToDolist. Conceptually the ToDo list uses a structure called MyToDo to hold information about each todo item. The members of the MyToDo struct are description, due date, and priority. Each of these items will be stored in an array called ToDoList. The definition for the MyToDo struct should be placed in the header file called ToDo.h Visually think of the ToDoList like this: There are two ways to add items to...

  • Please Write the following program in c# You are to write an application which will create...

    Please Write the following program in c# You are to write an application which will create a company, add agents (their name, ID, and weekly sales) to that company, and printout the details of all agents in the company. The application will contain three classes: Agent.cs, Company.cs, and CompanyTest.cs (this class is already provided). Flow of the application: The CompanyTest class creates an object of the Company class and reserves space for five agents. At this point if you call...

  • DIRECTIONS FOR THE WHOLE PROJECT BELOW BigInt class The purpose of the BigInt class is to...

    DIRECTIONS FOR THE WHOLE PROJECT BELOW BigInt class The purpose of the BigInt class is to solve the problem using short methods that work together to solve the operations of add, subtract multiply and divide.   A constructor can call a method called setSignAndRemoveItIfItIsThere(). It receives the string that was sent to the constructor and sets a boolean variable positive to true or false and then returns a string without the sign that can then be processed by the constructor to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT