Search for question
Question

Part 4

Implement a gradient descent function for linear regression:

Wat was (w/x-Mix)

The function will take trainData (RDD of LabeledPoint) as an argument and return a

tuple of weights and training errors. Reuse the code that you have written in Part 1

and 2. Initialize the elements of vector w = 0 and a = 1. Update the value of a in th

iteration using the formula:

Test the function on and example RDD. Run it for 5 iterations and print the results.

Fig: 1