Week 6
Week 6
= [2, 2, 3, 1]
= [1, 1, 3, 1]
= [3, 2, 4, 1]
= [1, 2, 1, 1]
Options
(a)
(b)
(c)
(d)
Answer
(d)
Solution
Total error = MSE +
If MSE for all the given weights is same, the weight vector whose squared length is the least will be
chosen by Ridge Regression.
Question-2
Statement
Assuming that in the constrained version of ridge regression optimization problem, following are
the weight vectors to be considered, along with the mean squared error (MSE) produced by each:
If the value of is 13, which of the following weight vectors will be selected as the final weight
vector by ridge regression?
Options
(a)
(b)
(c)
(d)
Answer
(b)
Solution
We need to minimize MSE such that
for and .
Options
(a)
(b)
(c)
(d)
Answer
(c)
Solution
lies on the part of the function which is differentiable. For a differentiable function (subpart),
only one sub-gradient is possible which is the gradient itself.
lies at the intersection of two and . The function is not differentiable at this point (as left
slope is different from right slope). Hence there are multiple sub-gradients possible at .
lies on the part of the function which is differentiable. For a differentiable function (subpart),
only one sub-gradient is possible which is the gradient itself.
lies at the intersection of two and . The function is not differentiable at this point (as
left slope is different from right slope). Hence there are multiple sub-gradients possible at
Question-4
Statement
For a data set with 1000 data points and 50 features, 10-fold cross-validation will perform
validation of how many models?
Options
(a)
10
(b)
50
(c)
1000
(d)
500
Answer
(a)
Solution
In 10-fold cross validation, the data will be divided into 10 parts. In each of ten iterations, a model
will be built using nine of these parts and the remaining part will be used for validation. Hence, in
total, ten models will be validated.
Question-5
Statement
For a data set with 1000 data points and 50 features, assume that you keep 80% of the data for
training and remaining 20% of the data for validation during k-fold cross-validation. How many
models will be validated during cross-validation?
Options
(a)
80
(b)
20
(c)
(d)
Answer
(c)
Solution
If 20% of the data is used for validation, that means, 1/5th part is used for validation, which
means, 5-fold cross validation is being performed. In each iteration, one model will be validated.
Hence, total 5 models will be validated.
Question-6
Statement
For a data set with 1000 data points and 50 features, how many models will be trained during
Leave-One-Out cross-validation?
Options
(a)
1000
(b)
50
(c)
5000
(d)
20
Answer
(a)
Solution
In leave one out cross-validation, only one data point is used for validation in each iteration, and
the remaining n-1 data points are used for training. Hence a total of n = 1000 models will be
trained.
Question-7
Statement
The mean squared error of will be small if
Options
(a)
(b)
(c)
(d)
Answer
(c), (d)
Solution
Mean Squared error of . Trace of a matrix = sum of eigenvalues.
If the eigenvalues of are large, the eigenvalues of will be small. Hence, trace will
be small and in turn MSE will be small.
Question-8
Statement
The eigenvalues of a matrix are 2, 5 and 1. What will be the eigenvalues of the matrix
Options
(a)
4, 25, 1
(b)
2, 5, 1
(c)
0.5, 0.2, 1
(d)
Answer
(c)
Solution
If the eigenvalues of A are a, b and c, then the eigenvalues of will be 1/a, 1/b and 1/c.