Machine Learning Techniques Quiz 2: 10 July 2022 (May 2022 term)
The IIT Madras BS Machine Learning Techniques (MLT) Quiz 2 paper sat on 10 Jul 2022, in the May 2022 term: 25 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.
- 25
- 50
- 120 min
- 12
- 4
- 9
Show answer
Correct answer
Question 2
A logistic regression model is being trained on a dataset of size . The first data-points belong to class-1 and the rest in class-0. Note that we are talking about the true label here.
The probability output by the model at any step in the training process is given by:
Which of the following expressions is the loss of the model?
NOTE: We use the binary cross entropy loss for logistic regression. Labels are 1 and 0 for the two classes.
Show answer
Correct answer
Question 3
Show answer
Correct answer
Question 4
Bernoulli NB
Categorical NB
Multinomial NB
Gaussian NB
Show answer
Correct answer
Bernoulli NB
Question 5
Show answer
Correct answer
Question 6
Which of the following could be the decision boundary learned by a hard-margin SVM? Choose the most appropriate option.
NOTE: The dataset is the same for all four options.
Show answer
Correct answer
Question 7
Show answer
Correct answer
Question 8
Show answer
Correct answer
Question 9
Which of the following could be the vector of probabilities output by a softmax regression model for 5 classes? Note that the options are independent of each other.
Show answer
Correct answers
Question 10
Show answer
Correct answer: 100
Question 11
Show answer
Correct answer
Question 12
Consider a logistic regression model that is trained on videos to detect objectionable content. Videos with objectionable content belong to the positive class (label 1). Harmless videos belong to the negative class (label 0).
A good detector should be able to correctly identify almost all videos that are objectionable. If it incorrectly classifies even a single video that has inappropriate content in it, that could have serious consequences, as millions of people might end up watching it. In this process the detector may classify some harmless videos as belonging to the positive class. But that is a price we are willing to pay.
How should we choose the threshold (for inference) of this logistic regression model?
The threshold should be a low value.
The threshold should be a high value.
The performance of the classifier is independent of the threshold.
Show answer
Correct answer
The threshold should be a low value.
Question 13
Consider a binary classification task that has 2 features. Assume that we train a soft-margin, linear SVM (decision boundary is a line in 2D space). We know nothing about the distribution of points in the training set. The points need not be linearly separable.
This model is now tested on the following dataset that has four points.
What are the possible values of the accuracy of the model? All options are independent of each other. Assume that the decision boundary of the model does not pass through any one of the four points.
0
0.25
0.5
0.75
1
Show answer
Correct answers
0.25
0.5
0.75
Question 14
An SVM model that has been trained for a binary classification task has the following weight vector and bias:
This model is tested on a dataset with 10 samples as given below. Here, is a feature vector and is the true label.
| 8 | 1 | 1 |
| 10 | 5 | 1 |
| 4 | 4 | 1 |
| 1 | 1 | 1 |
| -1 | 2 | 1 |
| 4 | 1 | -1 |
| 3 | 6 | -1 |
| 2 | 2 | -1 |
| 1 | 2 | -1 |
| -1 | 1 | -1 |
Compute the accuracy of the model on this dataset. Enter your answer between 0 and 1.
Hint: The Cartesian coordinate system was named after Rene Descartes.
Show answer
Correct answer: 0.7 (accepted within ±0.01)
Question 15
Based on the above data, answer the given subquestions.
Show answer
Correct answer: 0
Question 16
Based on the above data, answer the given subquestions.
Show answer
Correct answer: 1
Question 17
Based on the above data, answer the given subquestions.
Show answer
Correct answer: 2
Question 18
What is the predicted label of the test point if k = 1? The label is 1 for the positive class and –1 for the negative class.
1
-1
Show answer
Correct answer
1
Question 19
How many points are at a distance of 2 from the test point?
Note:
(1) We use the Manhattan distance.
(2) We want those points that are exactly 2 units away from the test point.
2 points from the positive class
3 points from the positive class
2 points from the negative class
3 points from the negative class
Show answer
Correct answers
2 points from the positive class
3 points from the negative class
Question 20
Based on the above data, answer the given subquestions.
Show answer
Correct answer
Question 21
Based on the above data, answer the given subquestions.
Show answer
Correct answer
Question 22
Consider a binary classification problem. The training-data has several features out of which we have access to only two binary features . The labels are and for the two classes. The training dataset has the following distribution of points:
| Feature | Number of points | True label |
|---|---|---|
| 30 | 1 | |
| 10 | 2 | |
| 10 | 1 | |
| 40 | 2 | |
| 30 | 1 | |
| 10 | 2 | |
| 10 | 1 | |
| 50 | 2 |
The table is to be parsed as follows. The first row of the table states that there are points from class that have . A Bernoulli Naive Bayes model is fit for this data with the following matrix of probabilities:
Each entry in this matrix can be understood as follows. For :
You can ignore smoothing. For all questions, report the answer up to two decimal places. Do not round-up or round-down the answer.
For example, if you get a value of , just report .
NOTE: If the last row of the table is not clear: for feature vector in class-2, there are fifty points.
Based on the above data, answer the given subquestions.
Show answer
Correct answer: 0.5 (accepted within ±0.01)
Question 23
Consider a binary classification problem. The training-data has several features out of which we have access to only two binary features . The labels are and for the two classes. The training dataset has the following distribution of points:
| Feature | Number of points | True label |
|---|---|---|
| 30 | 1 | |
| 10 | 2 | |
| 10 | 1 | |
| 40 | 2 | |
| 30 | 1 | |
| 10 | 2 | |
| 10 | 1 | |
| 50 | 2 |
The table is to be parsed as follows. The first row of the table states that there are points from class that have . A Bernoulli Naive Bayes model is fit for this data with the following matrix of probabilities:
Each entry in this matrix can be understood as follows. For :
You can ignore smoothing. For all questions, report the answer up to two decimal places. Do not round-up or round-down the answer.
For example, if you get a value of , just report .
NOTE: If the last row of the table is not clear: for feature vector in class-2, there are fifty points.
Based on the above data, answer the given subquestions.
Show answer
Correct answer: 0.54 (accepted within ±0.01)
Question 24
Consider a binary classification problem. The training-data has several features out of which we have access to only two binary features . The labels are and for the two classes. The training dataset has the following distribution of points:
| Feature | Number of points | True label |
|---|---|---|
| 30 | 1 | |
| 10 | 2 | |
| 10 | 1 | |
| 40 | 2 | |
| 30 | 1 | |
| 10 | 2 | |
| 10 | 1 | |
| 50 | 2 |
The table is to be parsed as follows. The first row of the table states that there are points from class that have . A Bernoulli Naive Bayes model is fit for this data with the following matrix of probabilities:
Each entry in this matrix can be understood as follows. For :
You can ignore smoothing. For all questions, report the answer up to two decimal places. Do not round-up or round-down the answer.
For example, if you get a value of , just report .
NOTE: If the last row of the table is not clear: for feature vector in class-2, there are fifty points.
Based on the above data, answer the given subquestions.
Show answer
Correct answer: 0.25 (accepted within ±0.01)
Question 25
Consider a binary classification problem. The training-data has several features out of which we have access to only two binary features . The labels are and for the two classes. The training dataset has the following distribution of points:
| Feature | Number of points | True label |
|---|---|---|
| 30 | 1 | |
| 10 | 2 | |
| 10 | 1 | |
| 40 | 2 | |
| 30 | 1 | |
| 10 | 2 | |
| 10 | 1 | |
| 50 | 2 |
The table is to be parsed as follows. The first row of the table states that there are points from class that have . A Bernoulli Naive Bayes model is fit for this data with the following matrix of probabilities:
Each entry in this matrix can be understood as follows. For :
You can ignore smoothing. For all questions, report the answer up to two decimal places. Do not round-up or round-down the answer.
For example, if you get a value of , just report .
NOTE: If the last row of the table is not clear: for feature vector in class-2, there are fifty points.
Based on the above data, answer the given subquestions.
Show answer
Correct answer: 0.81 (accepted within ±0.01)
