uiz Space

January 2025 term · Machine Learning Techniques · BSCS2007

Machine Learning Techniques Quiz 2: 16 March 2025 (January 2025 term)

The IIT Madras BS Machine Learning Techniques (MLT) Quiz 2 paper sat on 16 Mar 2025, in the January 2025 term: 14 questions for 40 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
14
Marks
40
Duration
120 min
MCQ
6
MSQ
2
Numerical
6

Updated

Official paper: IIT M DIPLOMA AN EXAM QDD2 16 Mar 2025 · No negative marking.

Question 1

+3 marksOne correct option

Below is the constrained version of the ridge regression optimization problem:

min⁡w∈R∑i=1n(wTxi−yi)2\min_{w \in \mathbb{R}} \sum_{i=1}^{n} (w^T x_i - y_i)^2

subject to ∣∣w∣∣2≤θ.\text{subject to } ||w||^2 \leq \theta.

Following are the weight vectors to be considered, along with the mean squared error (MSE) produced by each:

w1=[1111]Tw_1 = \begin{bmatrix} 1 & 1 & 1 & 1 \end{bmatrix}^T, MSE=2MSE = 2
w2=[0213]Tw_2 = \begin{bmatrix} 0 & 2 & 1 & 3 \end{bmatrix}^T, MSE=7MSE = 7
w3=[1201]Tw_3 = \begin{bmatrix} 1 & 2 & 0 & 1 \end{bmatrix}^T, MSE=1MSE = 1
w4=[2112]Tw_4 = \begin{bmatrix} 2 & 1 & 1 & 2 \end{bmatrix}^T, MSE=8MSE = 8

If θ=10\theta = 10, which of the following weight vectors will be selected as the final weight vector by ridge regression?

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

Correct answer

  • C

Question 2

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

Correct answer

  • B

Question 3

+2 marksOne correct option

p is the proportion of points with label 1 in some node in a decision tree. Which of the following statements are true?

  1. A

    As the value of p increases from 0 to 1, the impurity of the node increases.

  2. B

    As the value of p increases from 0 to 1, the impurity of the node decreases.

  3. C

    The impurity of the node does not depend on p.

  4. D

    p = 0.5 correspond to the case of maximum impurity.

Show answer

Correct answer

  • D

    p = 0.5 correspond to the case of maximum impurity.

Question 4

+2 marksOne correct option
  1. A

    To prevent numerical errors when calculating the variance of Gaussian features.

  2. B

    To ensure that unseen categorical feature values receive small but nonzero probabilities.

  3. C

    To strengthen the model’s predictions by increasing the weight of certain features.

  4. D

    To balance the likelihood values of all features before computing posterior probabilities.

Show answer

Correct answer

  • B

    To ensure that unseen categorical feature values receive small but nonzero probabilities.

Question 5

+4 marksOne correct option

Consider the following feature (xx) along with its label (yy):

xxyy
11
−1-11
21
−2-20
30
41

If you are provided with the following two questions, which one should you choose for the first(top) node of the decision tree?

(a) x≤−2x \leq -2
(b) x≤−1x \leq -1

Recall: Information gain =Entropy(D)−γEntropy(DYes)−(1−γ)Entropy(DNo)= \text{Entropy}(D) - \gamma \text{Entropy}(D_{Yes}) - (1 - \gamma) \text{Entropy}(D_{No})

Use the following values if required:
log⁡2(3/4)=−0.41,log⁡2(4/5)=−0.32,log⁡2(1/5)=−2.32,log⁡2(1/4)=−2,log⁡2(1/2)=−1.\log_2(3/4) = -0.41, \log_2(4/5) = -0.32, \log_2(1/5) = -2.32, \log_2(1/4) = -2, \log_2(1/2) = -1.

  1. A

    (a)

  2. B

    (b)

  3. C

    Insufficient information

Show answer

Correct answer

  • A

    (a)

Question 6

+3 marksOne or more correct options

Select all that apply.

  1. A

    It ensures that the regression model remains linear.

  2. B

    It computes the similarity between data points in a transformed feature space.

  3. C

    It allows the model to capture non-linear relationships by mapping data to a higher-dimensional space.

  4. D

    It helps in reducing the variance of the model.

  5. E

    It minimizes the loss function in regression problems.

Show answer

Correct answers

  • B

    It computes the similarity between data points in a transformed feature space.

  • C

    It allows the model to capture non-linear relationships by mapping data to a higher-dimensional space.

Question 7

+3 marksOne or more correct options

Select all that apply.

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

Correct answers

  • A
  • C

Question 8

+4 marksNumerical answer

Consider a kernel regression problem on the following dataset with two features:

{(x1,y1),(x2,y2),(x3,y3)}\{(x_1, y_1), (x_2, y_2), (x_3, y_3)\}

where:

x1=[12]T,y1=3,x2=[23]T,y2=5,x3=[34]T,y3=7x_1 = \begin{bmatrix} 1 & 2 \end{bmatrix}^T, y_1 = 3, \quad x_2 = \begin{bmatrix} 2 & 3 \end{bmatrix}^T, y_2 = 5, \quad x_3 = \begin{bmatrix} 3 & 4 \end{bmatrix}^T, y_3 = 7

The kernel function is given as:

K(x,x′)=(1+x⊤x′)2K(x, x') = (1 + x^\top x')^2

and the optimal coefficients αi\alpha_i are given as:

α=[0.51.01.5]T.\alpha = \begin{bmatrix} 0.5 & 1.0 & 1.5 \end{bmatrix}^T.

Then, what will be the predicted value for the data point [22]T\begin{bmatrix} 2 & 2 \end{bmatrix}^T?

Show answer

Correct answer: 483

Question 9

+4 marksNumerical answer

Consider a Naive Bayes problem with three features, f1,f2f_1, f_2 and f3f_3 for a binary classification problem. We have a total of 6 training samples given in the table below:

Samplef1f_1f2f_2f3f_3yy
x1x_10110
x2x_21010
x3x_30010
x4x_40001
x5x_51011
x6x_60101

For xtest=[110]Tx_{test} = \begin{bmatrix} 1 & 1 & 0 \end{bmatrix}^T, what output would Naive Bayes model predict assuming that no Laplacian smoothing has been done as part of the algorithm?

Show answer

Correct answer: 1

Question 10

+3 marksNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 7

Question 11

+2 marksNumerical answer

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 35

Question 12

+2 marksNumerical answer

Consider the following 2D data points along with its labels:

xxyy
[11]T\begin{bmatrix} 1 & 1 \end{bmatrix}^T1
[1−1]T\begin{bmatrix} 1 & -1 \end{bmatrix}^T1
[21]T\begin{bmatrix} 2 & 1 \end{bmatrix}^T1
[22]T\begin{bmatrix} 2 & 2 \end{bmatrix}^T1
[2−2]T\begin{bmatrix} 2 & -2 \end{bmatrix}^T0
[3−3]T\begin{bmatrix} 3 & -3 \end{bmatrix}^T0
[4−1]T\begin{bmatrix} 4 & -1 \end{bmatrix}^T1

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 1

Question 13

+3 marksNumerical answer

Consider the following 2D data points along with its labels:

xxyy
[11]T\begin{bmatrix} 1 & 1 \end{bmatrix}^T1
[1−1]T\begin{bmatrix} 1 & -1 \end{bmatrix}^T1
[21]T\begin{bmatrix} 2 & 1 \end{bmatrix}^T1
[22]T\begin{bmatrix} 2 & 2 \end{bmatrix}^T1
[2−2]T\begin{bmatrix} 2 & -2 \end{bmatrix}^T0
[3−3]T\begin{bmatrix} 3 & -3 \end{bmatrix}^T0
[4−1]T\begin{bmatrix} 4 & -1 \end{bmatrix}^T1

Based on the above data, answer the given subquestions.

Compute the Leave-one-out cross validation (LOOCV) error for the 3- nearest neighbour (3-NN) algorithm on this dataset. Enter the answer correct to two decimal places.

Show answer

Correct answer: 0.43 (accepted within ±0.02)

Question 14

+2 marksOne correct option

Consider the following 2D data points along with its labels:

xxyy
[11]T\begin{bmatrix} 1 & 1 \end{bmatrix}^T1
[1−1]T\begin{bmatrix} 1 & -1 \end{bmatrix}^T1
[21]T\begin{bmatrix} 2 & 1 \end{bmatrix}^T1
[22]T\begin{bmatrix} 2 & 2 \end{bmatrix}^T1
[2−2]T\begin{bmatrix} 2 & -2 \end{bmatrix}^T0
[3−3]T\begin{bmatrix} 3 & -3 \end{bmatrix}^T0
[4−1]T\begin{bmatrix} 4 & -1 \end{bmatrix}^T1

Based on the above data, answer the given subquestions.

Is it possible to reduce the cross-validation error obtained in the previous question by changing the label of certain points?

  1. A

    Yes

  2. B

    No

  3. C

    Cannot conclude from the given information.

Show answer

Correct answer

  • A

    Yes