Quiz Space

May 2023 term · Machine Learning Techniques · BSCS2007

Machine Learning Techniques Quiz 2: 6 August 2023 (May 2023 term)

The IIT Madras BS Machine Learning Techniques (MLT) Quiz 2 paper sat on 6 Aug 2023, in the May 2023 term: 16 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
16
Marks
50
Duration
120 min
MCQ
4
MSQ
3
Numerical
9

Updated

Official paper: IIT M FOUNDATION AN2 EXAM QPF2 06 Aug 2023 · No negative marking.

Question 1

+4 marksOne correct option

Consider a training dataset of nn points for a regression problem. Assume that the model is linear. Let w1\mathbf{w}_1 and w2\mathbf{w}_2 be the optimal weight vectors obtained from solving the following optimization problems.

w1=arg⁡min⁡w ∑i=1n(wTxi−yi)2\mathbf{w}_1 = \underset{\mathbf{w}}{\arg\min} \ \sum_{i=1}^{n} (\mathbf{w}^T\mathbf{x}_i - y_i)^2

w2=arg⁡min⁡w ∑i=1n(wTxi−yi)3\mathbf{w}_2 = \underset{\mathbf{w}}{\arg\min} \ \sum_{i=1}^{n} (\mathbf{w}^T\mathbf{x}_i - y_i)^3

Choose the most appropriate answer.

  1. A
  2. B
  3. C
Show answer

Correct answer

  • A

Question 2

+4 marksOne correct option
  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 3

+4 marksOne or more correct options

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • A
  • D

Question 4

+4 marksOne or more correct options

Which of the following statements are true about the decision tree algorithm?

Select all that apply.

  1. A

    Decision trees are prone to overfit if the maximum depth is set too low.

  2. B

    Decision trees are prone to underfit if the maximum depth is set too low.

  3. C

    Decision trees are sensitive to small perturbations in the dataset and can result in different tree structures.

  4. D

    Decision trees can handle both numerical and categorical features.

Show answer

Correct answers

  • B

    Decision trees are prone to underfit if the maximum depth is set too low.

  • C

    Decision trees are sensitive to small perturbations in the dataset and can result in different tree structures.

  • D

    Decision trees can handle both numerical and categorical features.

Question 5

+4.5 marksOne or more correct options

Which of the following statements is/are true regarding solution of Ridge regression problem?

Select all that apply.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answers

  • A
  • C

Question 6

+4.5 marksNumerical answer

Consider kernel regression with the kernel function (x1Tx2+2)2(\mathbf{x}_1^T\mathbf{x}_2 + 2)^2 applied on the following dataset.

X=[102030010203000000]\mathbf{X} = \begin{bmatrix} 1 & 0 & 2 & 0 & 3 & 0 \\ 0 & 1 & 0 & 2 & 0 & 3 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}

The optimal weight vector w∗\mathbf{w}^* is given by:

w∗=ϕ(X)[0.1,2,3.9,5,6,8]T\mathbf{w}^* = \phi(X)[0.1, 2, 3.9, 5, 6, 8]^T

where ϕ\phi is transformation mapping corresponding to the given kernel. What will be the prediction for the data point [0,0,1]T[0, 0, 1]^T?

Show answer

Correct answer: 100

Question 7

+4 marksNumerical answer
Show answer

Correct answer: 100

Question 8

+4 marksNumerical answer

Consider the following data set:

X=[8,6,10]X = [8, 6, 10]

Assuming a ridge penalty λ=100\lambda = 100, what will be the value of w^ridgew^MLE\frac{\hat{w}_{ridge}}{\hat{w}_{MLE}}?

Here w^ridge\hat{w}_{ridge} and w^MLE\hat{w}_{MLE} are the Ridge and MLE estimates of the weight vectors, respectively. Assume that the label vector yy of shape (3,1)(3, 1) is known. Enter your answer correct to two decimal places.

Show answer

Correct answer: 0.675 (accepted within ±0.025)

Question 9

+2.5 marksNumerical answer
Show answer

Correct answer: 0

Question 10

+1.5 marksOne correct option

Consider a binary classification problem and a decision tree that is being trained to classify the points. In one of the internal nodes in this tree, 75% of the data-points belong to one of the two classes and the rest belong to the other class. You are not given the information about which class is more numerous in this node.
Based on the above data, answer the given subquestions.

Do you have enough information to find the entropy of this node?

  1. A

    Yes

  2. B

    No

Show answer

Correct answer

  • A

    Yes

Question 11

+3 marksNumerical answer

Consider a binary classification problem and a decision tree that is being trained to classify the points. In one of the internal nodes in this tree, 75% of the data-points belong to one of the two classes and the rest belong to the other class. You are not given the information about which class is more numerous in this node.
Based on the above data, answer the given subquestions.

If the answer to the previous questions is "Yes", find the entropy of the node. Use log2 and enter your answer correct to three decimal places.
If the answer to the previous question is "No", enter -1 as your answer.

Show answer

Correct answer: 0.81 (accepted within ±0.02)

Question 12

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

If p = P ( y = 1 ) is estimated to be 0.4, what will be the prediction for the point x = 3 using the Bayes classifier? Enter 1 or -1.

Show answer

Correct answer: -1

Question 13

+2 marksOne correct option

Based on the above data, answer the given subquestions.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D

Question 14

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

If p = P (y = 1) is estimated to be 0.5 using MLE on a given training dataset, what will be the training error of the Bayes classifier for this problem?

Show answer

Correct answer: 0.5

Question 15

+2 marksNumerical answer

Consider a naive Bayes model is trained on the following data matrix XX of shape (d,n)(d, n) and corresponding label vector yy:

X=[100001000110]y=[1010]TX = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 \end{bmatrix} \quad y = \begin{bmatrix} 1 & 0 & 1 & 0 \end{bmatrix}^T

Assume that p^\hat{p} and p^jyi\hat{p}_j^{y_i} are estimates for P(y=1)P(y = 1) and P(fj=1∣y=yi)P(f_j = 1 | y = y_i), respectively. Here, fi; i=1,2,3f_i;\ i = 1, 2, 3 is the ithi^{th} feature. These parameters are estimated using MLE. Do not apply any smoothing on the dataset.

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0.5

Question 16

+2 marksNumerical answer

Consider a naive Bayes model is trained on the following data matrix XX of shape (d,n)(d, n) and corresponding label vector yy:

X=[100001000110]y=[1010]TX = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 1 & 1 & 0 \end{bmatrix} \quad y = \begin{bmatrix} 1 & 0 & 1 & 0 \end{bmatrix}^T

Assume that p^\hat{p} and p^jyi\hat{p}_j^{y_i} are estimates for P(y=1)P(y = 1) and P(fj=1∣y=yi)P(f_j = 1 | y = y_i), respectively. Here, fi; i=1,2,3f_i;\ i = 1, 2, 3 is the ithi^{th} feature. These parameters are estimated using MLE. Do not apply any smoothing on the dataset.

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 0