Question: Consider the following streaming version of linear regression algorithm. Algorithm StreamingSimpleLinearRegresssionModel 2 Double sumX = 0.0, sumY = 0.0, sumXY = 0.0, sumX =

Consider the following streaming version of linear regression algorithm. Algorithm StreamingSimpleLinearRegresssionModel 2

 Double sumX = 0.0, sumY = 0.0, sumXY = 0.0, sumX = 0.0, a = 0.0, b = 0.0 Double n Boolean dirty = 

Consider the following streaming version of linear regression algorithm. Algorithm StreamingSimpleLinearRegresssionModel 2 Double sumX = 0.0, sumY = 0.0, sumXY = 0.0, sumX = 0.0, a = 0.0, b = 0.0 Double n Boolean dirty = true Update() If (!dirty) then return 2 b=(sumXY(sumX * sumY)/n)/(sumX - (sumX * sumX)/n) a (sumY/n) - (b* sumX/n) dirty=false observe (double y, double x) sumX += x sumY+y sumXY+=x*y sumX += x*x n+= 1 dirty = true double getB() update() return b double getA() update() return a Following 5 pairs of stream data values are passed through the above model. X33554 Y 5 8 9 10 7 (A)What will be the coefficients "a" and "b" after model has processed second tuple? [2] (B)What will be the model expression when the model has processed first four tuples? [4] (C)After processing all the five tuples, what will be the prediction done by model for x = 1? [2]

Step by Step Solution

3.38 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The images show pseudocode for a streaming simple linear regression model and a series of questions related to the coefficients and predictions of the ... View full answer

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 Programming Questions!