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.
- 17
- 100
- 180 min
- 5
- 8
- 4
Show answer
Correct answer: 34
Question 2
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 and to capture your prior beliefs.
Calculate the posterior mean?
Show answer
Correct answer: 0.15 (accepted within ±0.03)
Question 3
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:
| Keyword | label of email | Probability |
|---|---|---|
| Won | Spam | |
| Won | Not Spam | |
| Money | Spam | |
| Money | Not Spam |
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
Show answer
Correct answers
Question 5
Show answer
Correct answers
Question 6
Which of the following statements is/are true?
Ridge regression and Lasso regression both puts a limit on the length of weight vector.
Ridge regression puts limit on length of the weight vector but LASSO regression does not put a limit on weight vector length.
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.
When many features are redundant, then linear regression is more appropriate than ridge regression and LASSO regression
Show answer
Correct answers
Ridge regression and Lasso regression both puts a limit on the length of weight vector.
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
Show answer
Correct answers
Question 8
Show answer
Correct answers
Question 9
Show answer
Correct answers
Question 10
Consider the following dataset with two features.
| X | y |
|---|---|
| [1,1] | 1 |
| [-1,-1] | 1 |
| [2,2] | 3 |
| [-2,-2] | 3 |
Which of the following property does the solution satisfy that fits the linear regression model ?
Show answer
Correct answer
Question 11
Show answer
Correct answer
Question 12
While training a perceptron model, the weight vector at some iteration is . The next two data-points picked up by the perceptron algorithm in the course of its execution is , and where is the true label:
What are the value of and ?
Show answer
Correct answer
Question 13
Consider the following optimization problem involving the variable :
What is the output of the following expression for ? Here, is the Lagrangian function for this optimization problem evaluated at .
Show answer
Correct answer
Question 14
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
Which of the following statements is/are true about the K-NN algorithm?
K-NN is sensitive to outliers in the dataset.
K-NN is a supervised learning algorithm used for classification.
K-NN assigns class labels to new instances based on a decision boundary learned from the training data.
The training dataset is not required while predicting the label of a test-point in the K-NN algorithm.
Show answer
Correct answers
K-NN is sensitive to outliers in the dataset.
K-NN is a supervised learning algorithm used for classification.
Question 16
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:
| True label | Predicted probability | |
|---|---|---|
| 1 | 0 | 0.8 |
| 2 | 1 | 0.2 |
| 3 | 0 | 0.6 |
| 4 | 1 | 0.9 |
| 5 | 1 | 0.3 |
For the given data set if Predicted probability is greater than 0.5, the predicted label will be 1 and 0 otherwise.
The values of 0-1 loss function will be 3
The values of squared loss will be equals to 2.14
The values of 0-1 loss equals 4.
The values of squared loss will be equals to 3.14
Show answer
Correct answers
The values of squared loss will be equals to 2.14
The values of 0-1 loss equals 4.
Question 17
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)
