CMSC471 Intro to Artificial Intelligence

16. (12 points) Equation 2 shows how MSE is calculated in Linear Regression, and Equation 3

shows how MAE is calculated where m is number of samples. Equation 4 shows how each

predicted value ˆy(i) is calculated.

MSE(θ) = 1

m

�m

i=1

(θT x(i) − y(i)

)2 (2)

MAE(θ) = 1

m

�m

i=1

| θT x(i) − y(i) | (3)

yˆ(i) = θ0 + θ1×1 + θ2×2 + θ3×3 + θ4×4 (4)

A regression model has been trained on a separate training set and the trained model parameters

(θ) vector is as follows:

θ = {θ0 = 0, θ1 = 2, θ2 = 1, θ3 = 0.5, θ4 = −1}

The regression test dataset for four samples is given in Figure 3. Each sample has values for

the four features {x1, x2, x3, x4} as well as the actual target value y(i)

Figure 3: Regression Dataset

(part a – 6 points) Compute MSE – show your complete work. (Hint: Compute the predicted

value ˆy(i) for each sample and then put them in Equation 2)

(part b – 6 points) Compute MAE – show your complete work. (Hint: Compute the predicted

value ˆy(i) for each sample and then put them in Equation 3)

Page 7 of 10

Sale!