Quiz Space

September 2023 term · Machine Learning Techniques · BSCS2007

MLT Quiz 2: 3 December 2023 (September 2023 term)

The IIT Madras BS Machine Learning Techniques (MLT) Quiz 2 paper sat on 3 Dec 2023, in the September 2023 term: 14 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
14
Marks
50
Duration
120 min
Numerical
8
MSQ
3
MCQ
3

Updated

Official paper: IIT M DIPLOMA AN2 EXAM QDD2 03 Dec 2023 · No negative marking.

Question 1

+4 marksNumerical answer
Show answer

Correct answer: 0

Question 2

+4 marksOne or more correct options

Suppose we transform the data points XX using a mapping Φ(⋅)\Phi(\cdot). Assume there exists a kernel matrix KK for the mapping Φ(⋅)\Phi(\cdot). Moreover, we categorize the model as parametric and non-parametric according to the following definitions.

  • Parametric: The samples in the training set are not necessary for making predictions on a test sample
  • non-Parametric: All the samples in the training set are necessary for making predictions on a test sample

Check all that is true about the kernel regression.

Select all that apply.

  1. A

    The kernel regression is parametric

  2. B

    The kernel regression is non-parametric

  3. C

    The Kernel matrix K is positive semi-definite

  4. D

    In general, Kernel regression is computationally expensive than a simple linear regression

Show answer

Correct answers

  • B

    The kernel regression is non-parametric

  • C

    The Kernel matrix K is positive semi-definite

  • D

    In general, Kernel regression is computationally expensive than a simple linear regression

Question 3

+4 marksNumerical answer

The team modifies the relation as y=XTw+ϵy = X^T w + \epsilon where ϵ∼N(0,σ2)\epsilon \sim \mathcal{N}(0, \sigma^2). Suppose that σ2=1\sigma^2 = 1, d=3d = 3 and n=100n = 100. Assume that ∑i=1n(wTxi−yi)2=0\sum_{i=1}^{n} (w^T x_i - y_i)^2 = 0 for w=w∗w = w^*. What is the negative log-likelihood of the dataset (X,y)(X, y) at w∗w^*? Use logarithm to base 1010.

Show answer

Correct answer: 39.5 (accepted within ±0.5)

Question 4

+4 marksOne correct option

In a Ridge regression scenario with the following dataset:

X=[−234]X = \begin{bmatrix} -2 & 3 & 4 \end{bmatrix}

And the corresponding target vector:

Y=[−151824]Y = \begin{bmatrix} -15 \\ 18 \\ 24 \end{bmatrix}

The regularization parameter is set at λ=3\lambda = 3. Calculate the ratio of the Maximum Likelihood Estimate (MLE) weight vector (wMLE)(w_{\text{MLE}}) to the Ridge weight vector (wRidge)(w_{\text{Ridge}}) and select the correct range.

  1. A

    (1.05, 1.20)

  2. B

    (0.85, 0.95)

  3. C

    (1,1)

  4. D

    (3, 3.5)

Show answer

Correct answer

  • A

    (1.05, 1.20)

Question 5

+4 marksOne or more correct options

Which of the following is/are the primary advantages of using L1 regularization

Select all that apply.

  1. A

    L1 regularization reduces the risk of overfitting.

  2. B

    L1 regularization tends to produce sparse models.

  3. C

    L1 regularization always improves the model’s predictive accuracy on large datasets.

  4. D

    L1 regularization is primarily used to increase model complexity.

Show answer

Correct answers

  • A

    L1 regularization reduces the risk of overfitting.

  • B

    L1 regularization tends to produce sparse models.

Question 6

+4 marksOne or more correct options

Select all the statements that are true about decision trees and k-Nearest Neighbors (k-NN) in machine learning:

Select all that apply.

  1. A

    Decision trees are a supervised learning algorithm used for classifications.

  2. B

    The k-NN algorithm is a lazy learner, which means it doesn’t build an explicit model during the training phase.

  3. C

    In k-NN, the value of k represents the number of features used for classification.

  4. D

    k-Nearest Neighbors (k-NN) is a parametric model that requires estimating probability distributions.

  5. E

    The depth of the tree is a hyperparameter and is typically chosen using cross- validation.

Show answer

Correct answers

  • A

    Decision trees are a supervised learning algorithm used for classifications.

  • B

    The k-NN algorithm is a lazy learner, which means it doesn’t build an explicit model during the training phase.

  • E

    The depth of the tree is a hyperparameter and is typically chosen using cross- validation.

Question 7

+4 marksOne correct option

Consider that the three weight vectors w1,w2\mathbf{w}_1, \mathbf{w}_2, and w3\mathbf{w}_3 are learned for an eight-dimensional dataset using different regression models (Not in any particular order).

w1=[0.32,−0.12,0,0.42,−0.18,−0.05,0.2,−0.09]w2=[0.25,−0.08,0.38,−0.22,0.14,−0.31,0.19,−0.12]w3=[0.22,−0.11,0.04,0.16,0.08,−0.03,0.1,−0.14]\begin{aligned} \mathbf{w}_1 &= [0.32, -0.12, 0, 0.42, -0.18, -0.05, 0.2, -0.09] \\ \mathbf{w}_2 &= [0.25, -0.08, 0.38, -0.22, 0.14, -0.31, 0.19, -0.12] \\ \mathbf{w}_3 &= [0.22, -0.11, 0.04, 0.16, 0.08, -0.03, 0.1, -0.14] \end{aligned}

Select the most appropriate match for these weight vectors.

  1. A

    w1 → Lasso regression, w2 → Linear regression, w3 → Ridge regression

  2. B

    w1→ Ridge regression, w2 → Lasso regression, w3 → Linear regression

  3. C

    w1 → Linear regression, w2 → Ridge regression, w3 → Lasso regression

  4. D

    w1 → Ridge regression, w2 → Linear regression, w3 → Lasso regression

Show answer

Correct answer

  • A

    w1 → Lasso regression, w2 → Linear regression, w3 → Ridge regression

Question 8

+4 marksOne correct option

Given a design matrix X∈Rd×nX \in \mathbb{R}^{d \times n} and a target vector Y∈Rn×1Y \in \mathbb{R}^{n \times 1}, where dd represents the number of features, nn represents the number of data points, and the data is defined as:

X=[2341]X = \begin{bmatrix} 2 & 3 \\ 4 & 1 \end{bmatrix}

Y=[24]Y = \begin{bmatrix} 2 \\ 4 \end{bmatrix}

Calculate the coefficients β\beta for Ridge regression with λ=2\lambda = 2.

  1. A

    β = [0.75, 0.75]

  2. B

    β = [1, 0.5]

  3. C

    β = [0.5, 1]

  4. D

    β = [0.85, 0.12]

  5. E

    None of these

Show answer

Correct answer

  • D

    β = [0.85, 0.12]

Question 9

+4 marksNumerical answer

You are working on a decision tree algorithm to classify whether a bank loan applicant will default on their loan based on several financial factors. The dataset includes Credit Score, Annual Income, Loan Amount, Loan Term as features.
The target variable is binary: 1 for ”Default” and 0 for ”No Default.”
You have a dataset of 500 loan applicants, and you want to construct a decision tree to predict loan default. To determine the first split (root node), you'll use the information gain as the criterion. Here’s the distribution of loan default in the dataset:
Default: 150 applicants No Default: 350 applicants
Calculate the Entropy for the initial dataset.

Show answer

Correct answer: 0.875 (accepted within ±0.045)

Question 10

+4 marksNumerical answer

Consider the problem of classifying an input text as positive sentiment or negative sentiment. For example, the text “I am happy” is positive and the text “ I am a bit worried” is negative. The dictionary that is used to encode the text into a vector contains 12 words. Suppose we prefer to use a generative learning algorithm that estimates the joint probability P(x,y)P(x, y), where x∈{0,1}12x \in \{0, 1\}^{12} and y∈{0,1}y \in \{0, 1\}. Assume that the features xix_i in a sample are not independent given the label. How many parameters do we need to estimate from the given data? (Enter -1 if you think the given information is insufficient to find the answer)

Show answer

Correct answer: 8191

Question 11

+2 marksNumerical answer

Given a training dataset with 100 data points, how many distances would we have to compute in the process of predicting the label of test-point in the k-NN algorithm with k = 5

Show answer

Correct answer: 100

Question 12

+2 marksNumerical answer

If the proportion of points belonging to class 1 in a node is p, for what value of p is the node’s entropy maximum?

Show answer

Correct answer: 0.5

Question 13

+3 marksNumerical answer

Consider the following dataset with 6 samples along with the corresponding labels. Each sample has three binary features f1,f2f_1, f_2 and f3f_3.

samplef1f_1f2f_2f3f_3yy
x1x_11101
x2x_20101
x3x_31000
x4x_40010
x5x_51010
x6x_61111

Assume that the features are conditionally independent given the label yy. Suppose the test sample is xtest=[0,1,1]Tx_{test} = [0, 1, 1]^T.

Based on the above data answer the given subquestions.

Show answer

Correct answer: 0

Question 14

+3 marksNumerical answer

Consider the following dataset with 6 samples along with the corresponding labels. Each sample has three binary features f1,f2f_1, f_2 and f3f_3.

samplef1f_1f2f_2f3f_3yy
x1x_11101
x2x_20101
x3x_31000
x4x_40010
x5x_51010
x6x_61111

Assume that the features are conditionally independent given the label yy. Suppose the test sample is xtest=[0,1,1]Tx_{test} = [0, 1, 1]^T.

Based on the above data answer the given subquestions.

What will be the predicted label according to the Naive Bayes decision rule?

Show answer

Correct answer: 1