Quiz Space

May 2023 term · Machine Learning Techniques · BSCS2007

MLT End Term: 3 September 2023, Set QPD1-S1 (May 2023 term)

The IIT Madras BS Machine Learning Techniques (MLT) End Term paper sat on 3 Sept 2023, in the May 2023 term, set QPD1-S1: 17 questions for 100 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
100
Duration
180 min
Numerical
5
MSQ
8
MCQ
4

Updated

Official paper: IIT M DIPLOMA ET1 EXAM QPD1 S2 03 Sep · No negative marking.

Question 1

+6 marksNumerical answer
Show answer

Correct answer: 34

Question 2

+6 marksNumerical answer

Suppose you have been given a task of estimating the conversion rate of google click of new online advertisement campaign. You have collected data from a limited sample of 1000 users, where 150 of them have converted. You want to use Bayesian estimation with a prior distribution to provide a more robust estimate of the conversion rate.

Assume you have prior information suggesting that conversion rates of click typically fall within the range of 0.1 to 0.3, and you decide to use a beta distribution as your prior. You choose a beta distribution with parameters α=5\alpha = 5 and β=20\beta = 20 to capture your prior beliefs.

Calculate the posterior mean?

Show answer

Correct answer: 0.15 (accepted within ±0.03)

Question 3

+6 marksNumerical answer

You are working on a text classification problem using a Naive Bayes classifier to determine whether an email is "Spam" or "Not Spam" . You have trained your model using a dataset of 1000 emails, with 600 of them labeled as "Spam" and 400 labeled as "Not Spam." You've collected statistics on the occurrence of two words, "Won" and "Money" in these emails:

Keywordlabel of emailProbability
WonSpamP(Won∥Spam)=0.45P(\text{Won} \Vert Spam) = 0.45
WonNot SpamP(Won∥NotSpam)=0.05P(\text{Won} \Vert NotSpam) = 0.05
MoneySpamP(Money∥Spam)=0.3P(\text{Money} \Vert Spam) = 0.3
MoneyNot SpamP(Money∥NotSpam)=0.02P(\text{Money} \Vert NotSpam) = 0.02

You receive a new email containing both the "Won" and "Money" keywords and want to classify it using Naive Bayes.

Use the Naive Bayes formula to calculate the probability that the new email is classified as "Spam."

Hint: Assume that these are only two possible words (that is there are only two features)

Show answer

Correct answer: 0.99 (accepted within ±0.01)

Question 4

+6 marksOne or more correct options

Select all that apply.

  1. A
  2. B
  3. C
Show answer

Correct answers

  • A
  • B

Question 5

+6 marksOne or more correct options

Select all that apply.

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

Correct answers

  • A
  • C
  • D

Question 6

+6 marksOne or more correct options

Which of the following statements is/are true?

Select all that apply.

  1. A

    Ridge regression and Lasso regression both puts a limit on the length of weight vector.

  2. B

    Ridge regression puts limit on length of the weight vector but LASSO regression does not put a limit on weight vector length.

  3. C

    When many features are redundant, then LASSO regression is more appropriate than ridge regression and linear regression as LASSO regression produces sparse weights for those features.

  4. D

    When many features are redundant, then linear regression is more appropriate than ridge regression and LASSO regression

Show answer

Correct answers

  • A

    Ridge regression and Lasso regression both puts a limit on the length of weight vector.

  • C

    When many features are redundant, then LASSO regression is more appropriate than ridge regression and linear regression as LASSO regression produces sparse weights for those features.

Question 7

+6 marksOne or more correct options

Select all that apply.

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

Correct answers

  • B
  • D

Question 8

+6 marksOne or more correct options

Select all that apply.

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

Correct answers

  • B
  • C

Question 9

+6 marksOne or more correct options

Select all that apply.

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

Correct answers

  • B
  • C
  • D

Question 10

+6 marksOne correct option

Consider the following dataset with two features.

Xy
[1,1]1
[-1,-1]1
[2,2]3
[-2,-2]3

Which of the following property does the solution ww satisfy that fits the linear regression model y=wTxy = w^T x?

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

Correct answer

  • A

Question 11

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

Correct answer

  • A

Question 12

+6 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 is (x1,y1)(\mathbf{x}_1, y_1), and (x2,y2)(\mathbf{x}_2, y_2) where yy is the true label:

wt=[1234],x1=[10−11],y1=1,x2=[−211−1],y2=−1\mathbf{w}^t = \begin{bmatrix} 1 \\ 2 \\ 3 \\ 4 \end{bmatrix}, \quad \mathbf{x}_1 = \begin{bmatrix} 1 \\ 0 \\ -1 \\ 1 \end{bmatrix}, \quad y_1 = 1, \quad \mathbf{x}_2 = \begin{bmatrix} -2 \\ 1 \\ 1 \\ -1 \end{bmatrix}, \quad y_2 = -1

What are the value 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

  • D

Question 13

+6 marksOne correct option

Consider the following optimization problem involving the variable w=[w1w2]T\mathbf{w} = \begin{bmatrix} w_1 & w_2 \end{bmatrix}^T:

min⁡w w12−3w2\min_{\mathbf{w}} \ w_1^2 - 3w_2

sub. tow1+7w2≤5\text{sub. to} \quad w_1 + 7w_2 \le 5

What is the output of the following expression for w′=[11]T\mathbf{w}' = \begin{bmatrix} 1 & 1 \end{bmatrix}^T? Here, L(w′,α)L(\mathbf{w}', \alpha) is the Lagrangian function for this optimization problem evaluated at w′\mathbf{w}'.

max⁡α≥0 L(w′,α)\max_{\alpha \ge 0} \ L(\mathbf{w}', \alpha)

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

Correct answer

  • D

Question 14

+5 marksNumerical answer

You are working on a spam email classification problem. You have collected a dataset of some 1000 emails, labeled as either "Spam" or "Not Spam," and you want to build a decision tree to classify them based on certain features. One of the features is the presence of a specific keyword: "Won."

Here's the breakdown of emails containing or not containing the keyword: "Won."

"Won" keyword present: 300 Spam, 50 Not Spam
"Won" keyword not present: 100 Spam, 550 Not Spam

Calculate the information gain for selecting the "Won" keyword feature for splitting.

Show answer

Correct answer: 0.35 (accepted within ±0.25)

Question 15

+3 marksOne or more correct options

Which of the following statements is/are true about the K-NN algorithm?

Select all that apply.

  1. A

    K-NN is sensitive to outliers in the dataset.

  2. B

    K-NN is a supervised learning algorithm used for classification.

  3. C

    K-NN assigns class labels to new instances based on a decision boundary learned from the training data.

  4. D

    The training dataset is not required while predicting the label of a test-point in the K-NN algorithm.

Show answer

Correct answers

  • A

    K-NN is sensitive to outliers in the dataset.

  • B

    K-NN is a supervised learning algorithm used for classification.

Question 16

+7 marksOne or more correct options

You are working on a binary classification problem where you need to predict whether an email is spam (1) or not (0). You have trained a machine learning model that produces predicted probabilities for each email being spam. You have two different loss functions to consider: the 0-1 loss and the squared loss.

You have a test dataset with the following true labels and predicted probabilities for a set of emails:

EmailTrue labelPredicted probability
100.8
210.2
300.6
410.9
510.3

For the given data set if Predicted probability is greater than 0.5, the predicted label will be 1 and 0 otherwise.

Select all that apply.

  1. A

    The values of 0-1 loss function will be 3

  2. B

    The values of squared loss will be equals to 2.14

  3. C

    The values of 0-1 loss equals 4.

  4. D

    The values of squared loss will be equals to 3.14

Show answer

Correct answers

  • B

    The values of squared loss will be equals to 2.14

  • C

    The values of 0-1 loss equals 4.

Question 17

+7 marksNumerical answer

Consider a simple neural network with one hidden layer. The network has the following architecture:

Input layer with 3 neurons.
Hidden layer with 2 neurons, using the sigmoid activation function.
Output layer with 1 neuron, using the linear activation function.

The weights and biases for the network are as follows:

Hidden Layer:

Neuron 1:
Weights: [0.5, -0.2, 0.8]
Bias: 0.1

Neuron 2:
Weights: [-0.3, 0.6, -0.7]
Bias: -0.4

Output Layer:

Neuron 1:
Weights: [0.2, 0.4]
Bias: -0.3

Assume that the input values are [0.6, 0.3, 0.8].

Calculate output of Neuron 1 in hidden layer

Show answer

Correct answer: 0.7 (accepted within ±0.1)