uiz Space

May 2025 term · Machine Learning Techniques · BSCS2007

Machine Learning Techniques End Term: 31 August 2025, Set QDB3 (May 2025 term)

The IIT Madras BS Machine Learning Techniques (MLT) End Term paper sat on 31 Aug 2025, in the May 2025 term, set QDB3: 17 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
17
Marks
50
Duration
180 min
MCQ
7
MSQ
4
Numerical
6

Updated

Official paper: IIT M DIPLOMA FN EXAM QDD1 31 Aug 2025 · No negative marking.

Question 1

+3 marksOne correct option

Consider the following dataset:

D={([−21],+1),([−11],+1),([−1−1],−1),([21],−1)}.D = \left\{\left(\begin{bmatrix} -2 \\ 1 \end{bmatrix}, +1\right), \left(\begin{bmatrix} -1 \\ 1 \end{bmatrix}, +1\right), \left(\begin{bmatrix} -1 \\ -1 \end{bmatrix}, -1\right), \left(\begin{bmatrix} 2 \\ 1 \end{bmatrix}, -1\right)\right\}.

The perceptron algorithm is applied on this data set with the weight vector initialized to [00]T\begin{bmatrix} 0 & 0 \end{bmatrix}^T. Will the algorithm converge after the second round of update of the weight vector? While looking for mistakes, cycle through the data points form left to right.

  1. A

    Yes

  2. B

    No

Show answer

Correct answer

  • B

    No

Question 2

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

Correct answer

  • C

Question 3

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

Correct answer

  • B

Question 4

+2 marksOne correct option

Consider KK-means clustering algorithm with K=2K = 2 on a one-dimensional dataset D={x1,x2,…,xn}D = \{x_1, x_2, \ldots, x_n\} aiming to minimize:

F(z1,z2,…,zn)=∑i=1n∣∣xi−μzi∣∣2,F(z_1, z_2, \ldots, z_n) = \sum_{i=1}^{n} ||x_i - \mu_{z_i}||^2,

where zi∈{1,2}z_i \in \{1, 2\} is the cluster assignment for point xix_i and μzi\mu_{z_i} is the mean of the assigned cluster.

For greedy initialization, choose the first center uniformly at random from DD, and the second as the point farthest from it (by Euclidean distance). Let FoptimalF_{\text{optimal}} be the minimum possible value of FF. Which of the following statements about greedy initialization is true?

  1. A

    Greedy initialization always achieves F = Foptimal by maximizing the distance between initial centers.

  2. B

    Greedy initialization may achieve F = Foptimal or a larger value depending on the dataset and the initial choice.

  3. C

    Greedy initialization does not ensure convergence for K-means clustering.

  4. D

    Greedy initialization ensures convergence to a unique solution for any dataset.

Show answer

Correct answer

  • B

    Greedy initialization may achieve F = Foptimal or a larger value depending on the dataset and the initial choice.

Question 5

+4 marksOne correct option

Suppose we are solving a binary classification task using a neural network with the following architecture:

  • Input: x=[11]x = \begin{bmatrix} 1 \\ 1 \end{bmatrix}
  • Hidden layer: 2 neurons (ReLU activation)
  • Output layer: 1 neuron (sigmoid activation)

The weight parameters of the network are given as:

W(1)=[w1(1)w2(1)w1(2)w2(2)]=[2−111],W(out)=[w1(out)w2(out)]T=[12]T,W^{(1)} = \begin{bmatrix} w_1^{(1)} & w_2^{(1)} \\ w_1^{(2)} & w_2^{(2)} \end{bmatrix} = \begin{bmatrix} 2 & -1 \\ 1 & 1 \end{bmatrix}, \quad W^{(out)} = \begin{bmatrix} w_1^{(out)} & w_2^{(out)} \end{bmatrix}^T = \begin{bmatrix} 1 & 2 \end{bmatrix}^T,

where wi(j)w_i^{(j)} represents the weight associated with the jj-th neuron for the ii-th input feature. What are the predicted probabilities?

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

Correct answer

  • D

Question 6

+3 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 overfitting if the maximum depth is set too shallow.

  2. B

    Decision trees are not affected by the order of features in the dataset.

  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

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

+3 marksOne or more correct options

Consider a 1D dataset which consists of 2 positive data points (points with label 1) {1,2}\{1, 2\} and 3 negative data points (points with label −1-1) {−3,−2,−1}\{-3, -2, -1\}. Suppose that we want to learn a soft-margin linear SVM for this data set. Consider the formulation of the soft-margin SVM:

min⁡w,ϵ12∣∣w∣∣2+C∑i=1nϵi,C≥0\min_{w, \epsilon} \frac{1}{2}||w||^2 + C\sum_{i=1}^{n} \epsilon_i, \qquad C \geq 0

subject to   (wTxi)yi+ϵi≥1,  ∀i\text{subject to } \; (w^Tx_i)y_i + \epsilon_i \geq 1, \; \forall i

ϵi≥0,  ∀i.\epsilon_i \geq 0, \; \forall i.

Select the correct options from the following:

Select all that apply.

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

Correct answers

  • A
  • D

Question 8

+3 marksOne or more correct options

Select all that apply.

  1. A
  2. B
  3. C
Show answer

Correct answers

  • A
  • B

Question 9

+4 marksOne or more correct options

Given a two-dimensional data set where points from class 1 are: {(−2, 3), (−1, 1)} and points from class 0 are: {(1, 3), (1, 4)}. Which of the following statements are true?

Select all that apply.

  1. A

    The given data points from classes 1 and 0 can be linearly separated using a hard-margin SVM.

  2. B

    A perceptron model and a hard-margin SVM can give different decision boundary for this dataset.

  3. C

    A soft-margin SVM would be a more robust choice than a hard-margin SVM for this dataset as the dataset is not linearly separable.

  4. D

    The width of the separation between the two supporting hyperplanes is 4.

Show answer

Correct answers

  • A

    The given data points from classes 1 and 0 can be linearly separated using a hard-margin SVM.

  • B

    A perceptron model and a hard-margin SVM can give different decision boundary for this dataset.

Question 10

+3 marksNumerical answer

Consider a dataset {x1,x2,x3,x4}\{x_1, x_2, x_3, x_4\}, where each xi∈R3x_i \in \mathbb{R}^3. The covariance matrix CC has three non-zero eigenvalues λ1>λ2>λ3\lambda_1 > \lambda_2 > \lambda_3 satisfying:

2λ1−λ2+λ3=82\lambda_1 - \lambda_2 + \lambda_3 = 8

λ1+2λ2−λ3=5\lambda_1 + 2\lambda_2 - \lambda_3 = 5

The difference between the largest and smallest eigenvalue is 3. Determine the total variance of the dataset.

Show answer

Correct answer: 6

Question 11

+3 marksNumerical answer

Consider a logistic regression model trained to predict whether a customer will buy a product (Y=1Y = 1) or not (Y=0Y = 0) based on two features: X1X_1: number of website visits per week and X2X_2: time spent on product pages per visit (minutes). The fitted model is:

p^=P(y=1∣x1,x2)=11+e−(0.4x1+0.1x2).\hat{p} = P(y = 1 \mid x_1, x_2) = \frac{1}{1 + e^{-(0.4x_1 + 0.1x_2)}}.

For a customer who spends 4 minutes per visit, find how many weekly visits are required to make the predicted probability of purchase equal to 0.7. Enter the answer correct to 2 decimal places.

Show answer

Correct answer: 1.12 (accepted within ±0.02)

Question 12

+3 marksNumerical answer

A random forest model consists of three decision trees. For a given test point, each tree outputs the following class probabilities for class +1+1 and class −1-1:

Tree 1:P(+1)=0.7,  P(−1)=0.3Tree 2:P(+1)=0.4,  P(−1)=0.6.Tree 3:P(+1)=0.8,  P(−1)=0.2\begin{aligned} &\text{Tree 1:} \quad P(+1) = 0.7, \; P(-1) = 0.3 \\ &\text{Tree 2:} \quad P(+1) = 0.4, \; P(-1) = 0.6. \\ &\text{Tree 3:} \quad P(+1) = 0.8, \; P(-1) = 0.2 \end{aligned}

The random forest predicts the final label by averaging the class probabilities across the trees and selecting the class with the higher average probability. What is the final predicted label for the test point? (Give the answer as 1 for class +1+1 or −1-1 for class −1-1.)

Show answer

Correct answer: 1

Question 13

+4 marksNumerical answer

A machine's lifetime (in hours) is modeled as a random variable X∼Exponential(λ)X \sim \text{Exponential}(\lambda). Suppose the observed lifetimes (in hours) of the machine over 8 trials are:

5.2, 0.8, 3.4, 2.5, 1.1, 4.0, 6.3, 2.95.2,\ 0.8,\ 3.4,\ 2.5,\ 1.1,\ 4.0,\ 6.3,\ 2.9

Assume that the parameter λ\lambda has a prior distribution given by λ∼Uniform(0,2)\lambda \sim \text{Uniform}(0, 2). Find the maximum a posteriori (MAP) estimate of λ\lambda. Enter the answer correct to two decimal plaes.

Recall that:

λ^MAP=arg⁡max⁡λ  f(λ∣{X1,…,Xn}),\hat{\lambda}_{\text{MAP}} = \arg\max_{\lambda} \; f(\lambda \mid \{X_1, \ldots, X_n\}),

where ff is the posterior distribution.

Show answer

Correct answer: 0.31 (accepted within ±0.03)

Question 14

+4 marksOne correct option

Based on the above data, answer the given subquestions.

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

Correct answer

  • C

Question 15

+2 marksOne correct option

Based on the above data, answer the given subquestions.

  1. A

    The coefficients shrinks towards zero.

  2. B

    The coefficients increases in magnitude.

  3. C

    The coefficients remain unchanged.

Show answer

Correct answer

  • B

    The coefficients increases in magnitude.

Question 16

+1 markNumerical answer

Consider a naive Bayes classification problem with three binary features f1,f2,f3f_1, f_2, f_3 for a binary classification problem. We have a total of 6 training samples given in the table below:

Samplef1f_1f2f_2f3f_3yy
x1x_11100
x2x_21010
x3x_31000
x4x_40011
x5x_50001
x6x_60101

Based on the above data, answer the given subquestions.

Show answer

Correct answer: 7

Question 17

+3 marksNumerical answer

Consider a naive Bayes classification problem with three binary features f1,f2,f3f_1, f_2, f_3 for a binary classification problem. We have a total of 6 training samples given in the table below:

Samplef1f_1f2f_2f3f_3yy
x1x_11100
x2x_21010
x3x_31000
x4x_40011
x5x_50001
x6x_60101

Based on the above data, answer the given subquestions.

If a test point has label 1, what is the probability of xtest=[111]Tx_{test} = \begin{bmatrix} 1 & 1 & 1 \end{bmatrix}^T? Assume that the Laplacian smoothing is done, (i.e., add two pseudo training exmaples xpseudo0=[111]Tx_{pseudo}^0 = \begin{bmatrix} 1 & 1 & 1 \end{bmatrix}^T for class 0 and xpseudo1=[111]Tx_{pseudo}^1 = \begin{bmatrix} 1 & 1 & 1 \end{bmatrix}^T for class 1).

Enter the answer correct to four decimal places.

Show answer

Correct answer: 0.0625