Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q . 1 . Consider the following streaming version of linear regression algorithm. Algorithm StreamingSimpleLinearRegresssionModel Double sumX = 0 . 0 , sumY = 0

Q.1. Consider the following streaming version of linear regression algorithm.
Algorithm StreamingSimpleLinearRegresssionModel
Double sumX =0.0, sumY =0.0, sumXY =0.0, sumX2=0.0, a =0.0, b =0.0
Double n
Boolean dirty = true
Update()
If (!dirty) then return
b =( sumXY (sumX * sumY)/ n )/( sumX2(sumX * sumX)/ n )
a =(sumY / n)(b * sumX / n)
dirty =false
observe (double y, double x)
sumX += x
sumY += y
sumXY += x * y
sumX2+= 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.
X 33554
Y 589107
(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

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions