Question 1
For the given data set
| x | y |
|---|---|
| 1 | 3 |
| 2 | 4 |
| 3 | 8 |
| 4 | 11 |
| 5 | 12 |
What is the mean squared error if the predicted model is given by ? Write your answer correct upto 2 decimal places, do not round up or off.
The IIT Madras BS Machine Learning Techniques (MLT) Quiz 1 paper sat on 5 Jun 2022, in the May 2022 term: 24 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.
For the given data set
| x | y |
|---|---|
| 1 | 3 |
| 2 | 4 |
| 3 | 8 |
| 4 | 11 |
| 5 | 12 |
What is the mean squared error if the predicted model is given by ? Write your answer correct upto 2 decimal places, do not round up or off.
Correct answer: 1.4 (accepted within ±0.02)
Consider the following confusion matrix. Positive class is represented by ‘True’ and negative class is represented by ‘False’.
Based on the above data, answer the given subquestions.
Find the value of the accuracy. Write your answer correct upto 2 decimal places, do not round up or off.
Correct answer: 0.56 (accepted within ±0.01)
Consider the following confusion matrix. Positive class is represented by ‘True’ and negative class is represented by ‘False’.
Based on the above data, answer the given subquestions.
Find the value of the precision. Write your answer correct upto 2 decimal places, do not round up or off.
Correct answer: 0.44 (accepted within ±0.01)
Consider the following confusion matrix. Positive class is represented by ‘True’ and negative class is represented by ‘False’.
Based on the above data, answer the given subquestions.
Find the value of the recall. Write your answer correct upto 2 decimal places, do not round up or off.
Correct answer: 0.525 (accepted within ±0.01)
Consider the following confusion matrix. Positive class is represented by ‘True’ and negative class is represented by ‘False’.
Based on the above data, answer the given subquestions.
Find the value of the F-1 score. Write your answer correct upto 2 decimal places, do not round up or off.
Correct answer: 0.4725 (accepted within ±0.0125)
Ajay has a dataset that has a non-linear relationship between the features and the label. The dimension of training samples is 4×2 (excluding the additional all-ones feature for the bias term, which you should add), label vector is 4 × 1 and weight vector is 3 × 1.
| 1 | |
| 1 | |
| 2 | |
| 2 |
| 0.1 |
| 0.2 |
| 0.3 |
Based on the above data, answer the given subquestions.
Suppose Ajay has to compute the ridge loss value for this data with regularization parameter value as 0.2 for performing ridge regression. What will be the value of ridge loss correct up to 2 decimal places?
Correct answer: 0.36 (accepted within ±0.01)
Ajay has a dataset that has a non-linear relationship between the features and the label. The dimension of training samples is 4×2 (excluding the additional all-ones feature for the bias term, which you should add), label vector is 4 × 1 and weight vector is 3 × 1.
| 1 | |
| 1 | |
| 2 | |
| 2 |
| 0.1 |
| 0.2 |
| 0.3 |
Based on the above data, answer the given subquestions.
For the same dataset, suppose Ajay has to compute the lasso loss value with regularization parameter value as 0.2 for performing lasso regression. What will be the value of lasso loss correct up to 2 decimal places?
Correct answer: 0.41 (accepted within ±0.02)
Based on the above data, answer the given subquestions.
What will be the prediction for an example having the features vector as (2, 1)? Assume the classes are 1 and −1.
NOTE: Enter your answer to the nearest integer.
Correct answer: -1
Based on the above data, answer the given subquestions.
Find the accuracy for the given test data-set. Write your answer correct to two decimal places.
Correct answer: 0.75 (accepted within ±0.02)
Consider the following code snippet
Based on the above data, answer the given subquestions.
What is the output of following code snippet?
Correct answer: 5
Consider the following code snippet
Based on the above data, answer the given subquestions.
What is the output of following code snippet?
Correct answer: 58
Abhishek trains a polynomial regression model on a dataset. He tries with different degree of polynomial transformation and gets following learning curve:
Based on the above data, answer the given subquestions.
What value of degree of polynomial transformation should Abhishek choose for the given dataset? NOTE: Enter your answer to the nearest integer.
Correct answer: 5
Abhishek trains a polynomial regression model on a dataset. He tries with different degree of polynomial transformation and gets following learning curve:
Based on the above data, answer the given subquestions.
What do you think will happen if Abhishek tries to fit a linear regression model with polynomial transformation of degree 20?
High validation loss and high training loss.
High validation loss and low training loss.
Low validation loss and high training loss.
Low validation loss and low training loss.
Correct answer
High validation loss and low training loss.
Multi-label, multi-class classification problem
Single-label, multi-class classification problem
Single-label, binary class classification problem
Multi-label, binary class classification problem
Correct answer
Multi-label, multi-class classification problem
[4, 5]^(T)
[5, 4]^(T)
[2, 3]^(T)
[4, 6]^(T)
Correct answer
[4, 5]^(T)
Brijmohan trains his linear regression model with three different values of learning rate, i.e. α1, α2 and α3, for the same training set. He gets learning curves as displayed in the following chart.
Which of the following correctly explains relationship among α1, α2 and α3?
α1 > α2 > α3
α1 < α2 < α3
α2 > α1 > α3
α3 > α2 > α1
α1 > α3 > α2
Correct answer
α1 < α2 < α3
Which of the following can NOT be a linear regression model?
Correct answers
Which of the following correctly computes the solution of linear regression problem via normal equation method? Assume necessary imports.
Correct answer
In ridge regression, the loss function is computed as J(w) = L + λP Where P is penalty term for ridge regularization, λ is rate of regularization and L is plain loss function without any regularization. Choose the correct statements from the following:
As λ tends to infinite, the solution of ridge regularization tends towards origin.
As λ tends to zero, the solution of ridge regularization tends towards origin.
As λ tends to infinite, the solution of ridge regularization tends towards the solution of least squares.
As λ tends to zero, the solution of ridge regularization tends towards the solution of least squares.
The penalty term P represents circles if we draw the contour plot of ridge loss function.
The penalty term P represents squares if we draw the contour plot of ridge loss function.
Correct answers
As λ tends to infinite, the solution of ridge regularization tends towards origin.
As λ tends to zero, the solution of ridge regularization tends towards the solution of least squares.
The penalty term P represents circles if we draw the contour plot of ridge loss function.
For the given dataset:
| x | y |
|---|---|
| 1 | 5 |
| 2 | 7 |
| 3 | 6 |
Assume the initial weight vector is and learning rate . Compute the weight vector after one iteration, let's call it . Compute prediction for correct upto two decimal points with new weight vector (i.e. ). Do not round up or off.
Correct answer: 15.6 (accepted within ±0.2)
Ankita had a feature vector x and she wanted to apply polynomial transformation on x. She had written a code snippet as follows:
import itertools, functoolsimport numpy as npx = np.array([[2, 3]])degree= 3x_t = x.transpose()features = [np.ones(len(x))]for degree in range(1, degree + 1): for items in itertools.combinations_with_replacement(x_t, degree): features.append(functools.reduce(lambda x, y: x * y, items))output = np.sum(np.asarray(features).transpose())print(int(output))What is the output of the code snippet?
Correct answer: 90
A classification model was trained on some training examples with two features and three classes (0, 1 and 2) using least square algorithm. The learnt weight matrix is
(Remember for k class classification problem with m features, shape of weight matrix is (m + 1) × k) Which class will the sample (-1, 1) be classified to?
NOTE: Enter your answer to the nearest integer.
Correct answer: 2
Consider the decision boundary learnt using a perceptron algorithm as shown in the figure. Find the loss associated with this model.
Note: Since, perceptron model doesn’t converge for non linearly separable data, we have terminated the learning process after a fixed numbers of iterations.
NOTE: Enter your answer to the nearest integer.
Correct answer: 5
NOTE: Enter your answer in two decimal places.
Correct answer: 1.025 (accepted within ±0.025)