Quiz Space

September 2024 term · Machine Learning Techniques · BSCS2007

MLT End Term: 22 December 2024, Set QDF3 (September 2024 term)

The IIT Madras BS Machine Learning Techniques (MLT) End Term paper sat on 22 Dec 2024, in the September 2024 term, set QDF3: 22 questions for 50 marks in 180 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.

Questions
22
Marks
50
Duration
180 min
Numerical
12
MSQ
3
MCQ
7

Updated

Official paper: IIT M FOUNDATION DIPLOMA AN EXAM QDF3 22 Dec 2024 · No negative marking.

Question 1

+2 marksNumerical answer

NOTE: Enter the answer correct to one decimal place

Show answer

Correct answer: 2.5

Question 2

+3 marksNumerical answer

Consider a dataset of 200 points where the ii-th data point is given by:

xi=ai⋅[3102]+bi⋅[1030],\mathbf{x}_i = a_i \cdot \begin{bmatrix} 3 \\ 1 \\ 0 \\ 2 \end{bmatrix} + b_i \cdot \begin{bmatrix} 1 \\ 0 \\ 3 \\ 0 \end{bmatrix},

where aia_i and bib_i are real numbers such that

∑i=1200ai=∑i=1200bi=0.\sum_{i=1}^{200} a_i = \sum_{i=1}^{200} b_i = 0.

Standard PCA is performed on this dataset. If the top two principal components are retained and used to reconstruct the dataset, what is the reconstruction error?

Show answer

Correct answer: 0

Question 3

+3 marksNumerical answer

A train running between two stations A and B will be late on any day by a random amount XX, where X∼Uniform[0,θ]X \sim \text{Uniform}[0, \theta]. Suppose the train is late by random amounts (in minutes)

10,45,17,20,49,52,15,4,32,3510, 45, 17, 20, 49, 52, 15, 4, 32, 35

independently on 10 days. Consider a Uniform[0,60]\text{Uniform}[0, 60] prior for the parameter θ\theta. Find the maximum aposteriori (MAP) estimate of θ\theta.

Recall that θ^MAP=arg⁡max⁡θ f(θ∣{X1,…,Xn})\hat{\theta}_{MAP} = \underset{\theta}{\arg\max}\ f(\theta \mid \{X_1, \ldots, X_n\}), where ff is the posterior distribution.

Show answer

Correct answer: 52

Question 4

+3 marksNumerical answer

Consider a logistic regression model trained to detect spam emails. Emails containing harmful phishing links are labeled as spam (1), while regular emails are labeled as not spam (0). A good spam detector should correctly identify almost all emails with phishing links. Even a single phishing email incorrectly classified as not spam could expose users to significant risks. However, the detector may classify some regular emails as spam. This trade-off is acceptable to ensure safety.
To ensure user safety, if the threshold is set to a low value to prioritize the detection of phishing emails, type 1. If the threshold is set to a high value to minimize false positives (misclassifying regular emails as spam), type 0.

Show answer

Correct answer: 1

Question 5

+3 marksOne or more correct options

Select the correct statements from the following for k-means algorithm:

Select all that apply.

  1. A

    In k-means algorithm, all cluster initializations lead to the same result.

  2. B

    k-means algorithm is sensitive to outliers.

  3. C

    One initialization may converge while another may not.

  4. D

    The initialization of cluster centres may affect the number of iterations k- means takes to converge.

Show answer

Correct answers

  • B

    k-means algorithm is sensitive to outliers.

  • D

    The initialization of cluster centres may affect the number of iterations k- means takes to converge.

Question 6

+3 marksOne or more correct options

Select all that apply.

  1. A

    Curve (A) represents the training loss.

  2. B

    Curve (B) represents the training loss.

  3. C

    Curve (A) represents the validation loss.

  4. D

    Curve (B) represents the validation loss.

Show answer

Correct answers

  • A

    Curve (A) represents the training loss.

  • D

    Curve (B) represents the validation loss.

Question 7

+4 marksOne correct option

Perform one round of the gradient descent algorithm for the linear regression on the below data

X=[1−20251],y=[161]X = \begin{bmatrix} 1 & -2 & 0 \\ 2 & 5 & 1 \end{bmatrix}, y = \begin{bmatrix} 1 \\ 6 \\ 1 \end{bmatrix}

with the initial weight vector w0=[10.5]w_0 = \begin{bmatrix} 1 \\ 0.5 \end{bmatrix} and learning rate η=0.01\eta = 0.01. Find the updated weight vector w1w_1 after one iteration of gradient descent.
Note: The objective function is given by f(w)=∣∣XTw−y∣∣2f(w) = ||X^T w - y||^2.

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

Correct answer

  • B

Question 8

+4 marksOne correct option

While training a perceptron model, the weight vector at some iteration tt is wt\mathbf{w}^t. The next two data points picked up by the perceptron algorithm in the course of its execution are (x1,y1)(\mathbf{x}_1, y_1) and (x2,y2)(\mathbf{x}_2, y_2), where yy is the true label:

wt=[12−1],x1=[0−10],y1=−1,x2=[−102],y2=1.\mathbf{w}^t = \begin{bmatrix} 1 \\ 2 \\ -1 \end{bmatrix}, \quad \mathbf{x}_1 = \begin{bmatrix} 0 \\ -1 \\ 0 \end{bmatrix}, y_1 = -1, \quad \mathbf{x}_2 = \begin{bmatrix} -1 \\ 0 \\ 2 \end{bmatrix}, y_2 = 1.

What are the values of wt+1\mathbf{w}^{t+1} and wt+2\mathbf{w}^{t+2}?

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

Correct answer

  • A

Question 9

+2 marksNumerical answer

Consider the following dataset for a binary classification problem in which the features are from {0,1}3\{0,1\}^3 and the labels are from {0,1}\{0,1\}.

X=[101101000101101111011001]\mathbf{X} = \begin{bmatrix} 1 & 0 & 1 & 1 & 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & 1 & 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 & 0 & 0 & 1 \end{bmatrix}

y=[11110000]T\mathbf{y} = \begin{bmatrix} 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \end{bmatrix}^T

A Naive Bayes classifier is trained on this dataset. The parameters to be estimated are represented as p^iy\hat{p}_i^y, which are presented in the form of the table given below:

iiy=0y = 0y=1y = 1
1aabb
2ccdd
3eeff

Assume that there is no smoothing. Answer the given sub-questions.

Show answer

Correct answer: 1

Question 10

+2 marksNumerical answer

Consider the following dataset for a binary classification problem in which the features are from {0,1}3\{0,1\}^3 and the labels are from {0,1}\{0,1\}.

X=[101101000101101111011001]\mathbf{X} = \begin{bmatrix} 1 & 0 & 1 & 1 & 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & 1 & 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 & 0 & 0 & 1 \end{bmatrix}

y=[11110000]T\mathbf{y} = \begin{bmatrix} 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \end{bmatrix}^T

A Naive Bayes classifier is trained on this dataset. The parameters to be estimated are represented as p^iy\hat{p}_i^y, which are presented in the form of the table given below:

iiy=0y = 0y=1y = 1
1aabb
2ccdd
3eeff

Assume that there is no smoothing. Answer the given sub-questions.

Show answer

Correct answer: 2

Question 11

+2 marksNumerical answer

Consider the following dataset for a binary classification problem in which the features are from {0,1}3\{0,1\}^3 and the labels are from {0,1}\{0,1\}.

X=[101101000101101111011001]\mathbf{X} = \begin{bmatrix} 1 & 0 & 1 & 1 & 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & 1 & 1 & 0 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 & 0 & 0 & 1 \end{bmatrix}

y=[11110000]T\mathbf{y} = \begin{bmatrix} 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 \end{bmatrix}^T

A Naive Bayes classifier is trained on this dataset. The parameters to be estimated are represented as p^iy\hat{p}_i^y, which are presented in the form of the table given below:

iiy=0y = 0y=1y = 1
1aabb
2ccdd
3eeff

Assume that there is no smoothing. Answer the given sub-questions.

Show answer

Correct answer: 1

Question 12

+5 marksNumerical answer

Given a training set An={(x1,y1),…,(xn,yn)}A_n = \{(x_1, y_1), \ldots, (x_n, y_n)\}, let An−iA_n^{-i} denote the set obtained by removing the label of the ii-th training example. Leave one out cross validation (LOOCV) is performed as follows: for each (xi,yi)(x_i, y_i) in the training set, we train the model on the remaining n−1n - 1 points of An−iA_n^{-i} and test the prediction on (xi,yi)(x_i, y_i). The error is defined as

errorL(An)=1n∑i=1n(yi−f^−i(xi))2,error_L(A_n) = \frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{f}^{-i}(x_i))^2,

where f^−i(xi)\hat{f}^{-i}(x_i) denote the predicted value of yiy_i using the model trained on An−iA_n^{-i}. Now, for the dataset:

D={(1,2),(2,3),(3,4)},D = \{(1, 2), (2, 3), (3, 4)\},

fit the model f^=βxi\hat{f} = \beta x_i and find errorL(A3)error_L(A_3). Enter the answer correct to two decimal places.

Show answer

Correct answer: 0.35 (accepted within ±0.05)

Question 13

+3 marksOne correct option

Consider the following optimization problem involving the variable x∈R2\mathbf{x} \in \mathbb{R}^2:

min⁡x x12+2x2subject tox1−x2≤3.\min_{\mathbf{x}}\ x_1^2 + 2x_2 \quad \text{subject to} \quad x_1 - x_2 \leq 3.

What is the output of the following expression for x′=[14]\mathbf{x}' = \begin{bmatrix} 1 \\ 4 \end{bmatrix}? Here, L(x′,λ)L(\mathbf{x}', \lambda) is the Lagrangian function for this optimization problem evaluated at x′\mathbf{x}'.

max⁡λ≥0L(x′,λ)\max_{\lambda \geq 0} L(\mathbf{x}', \lambda)

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

Correct answer

  • A

Question 14

+3 marksOne correct option

Which of the following options are not correct? Select all that apply.

  1. A

    Underfitted models generally have less bias and high variance.

  2. B

    A decision tree with the maximum possible length may lead to overfitting.

  3. C

    Weak learners are those whose performance is slightly better than the random classifier.

  4. D

    All the estimators in bagging can be trained parallelly.

Show answer

Correct answer

  • A

    Underfitted models generally have less bias and high variance.

Question 15

+2 marksOne correct option

If we remove all the non-support vectors from the dataset, what will be the impact on the model using SVM algorithm?

  1. A

    Model will overfit.

  2. B

    The model will not be changed.

  3. C

    Model will underfit.

  4. D

    Accuracy of the model will increase.

Show answer

Correct answer

  • B

    The model will not be changed.

Question 16

+2 marksOne correct option

In each round of AdaBoost, the weight for a particular training observation is decreased from round t to round t + 1 if the observation was:

  1. A

    classified incorrectly by the weak learner trained in the round.

  2. B

    classified correctly by the weak learner trained in the round.

  3. C

    classified incorrectly by a majority of the weak learners trained up to the round.

  4. D

    classified correctly by a majority of the weak learners trained up to the round.

Show answer

Correct answer

  • B

    classified correctly by the weak learner trained in the round.

Question 17

+1 markOne correct option

Is the following statement true or false?
For a fixed size of the training and the test set, increasing the complexity of the model always leads to an increment in the test error.

  1. A

    True

  2. B

    False

Show answer

Correct answer

  • B

    False

Question 18

+0.5 marksNumerical answer
Show answer

Correct answer: 1

Question 19

+0.5 marksNumerical answer
Show answer

Correct answer: 0

Question 20

+0.5 marksNumerical answer
Show answer

Correct answer: 0

Question 21

+0.5 marksNumerical answer
Show answer

Correct answer: 2

Question 22

+1 markOne or more correct options

Which of the following is correct ?

Select all that apply.

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

Correct answers

  • A
  • B