Quiz Space

September 2024 term · Machine Learning Techniques · BSCS2007

MLT End Term: 22 December 2024, Set QDF1 (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 QDF1: 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
MCQ
7
MSQ
3

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,55,17,20,49,51,15,4,32,3510, 55, 17, 20, 49, 51, 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: 55

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

+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,2),(0,1)},D = \{(1, 2), (2, 2), (0, 1)\},

fit the model f^=βxi\hat{f} = \beta x_i and find errorL(A3)error_L(A_3).

Show answer

Correct answer: 2

Question 6

+3 marksOne correct option
  1. A

    3, 5, 1, 4, 2

  2. B

    5, 3, 1, 2, 4

  3. C

    3, 5, 2, 4, 1

  4. D

    5, 3, 1, 4, 2

  5. E

    None of these

Show answer

Correct answer

  • D

    5, 3, 1, 4, 2

Question 7

+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 \geq 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

  • B

Question 8

+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.05\eta = 0.05. 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

  • D

Question 9

+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=[012],x1=[1−10],y1=1,x2=[−111],y2=−1.\mathbf{w}^t = \begin{bmatrix} 0 \\ 1 \\ 2 \end{bmatrix}, \quad \mathbf{x}_1 = \begin{bmatrix} 1 \\ -1 \\ 0 \end{bmatrix}, y_1 = 1, \quad \mathbf{x}_2 = \begin{bmatrix} -1 \\ 1 \\ 1 \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 10

+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 11

+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 12

+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 13

+3 marksOne or more correct options

Consider a supervised ML problem where a model is trained using a training dataset, and its performance is evaluated on both the training and validation datasets. During training, the model’s loss is plotted over time for both the datasets. Assume that the loss L(t) is decreasing as the model learns.
The following graph shows two curves, Curve (A) and Curve (B), representing the loss for the training and validation datasets, respectively:

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 14

+3 marksOne or more correct options

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

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 answers

  • B

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

  • C

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

  • D

    All the estimators in bagging can be trained parallelly.

Question 15

+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 16

+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 17

+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 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