uiz Space

May 2026 term · Machine Learning Practice · BSCS2008

Machine Learning Practice End Term: 13 September 2026 (May 2026 term)

The IIT Madras BS Machine Learning Practice (MLP) End Term paper sat on 13 Sept 2026, in the May 2026 term: 30 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
30
Marks
100
Duration
180 min
MCQ
13
Numerical
9
MSQ
8

Updated

Official paper: Machine Learning Practice 13 Sep 26 · No negative marking.

Question 1

+4 marksOne correct option

Consider the following pandas DataFrame representing employee training records:

We want to retrieve all records of employees who belong to departments where the average training score is strictly greater than 75. Which of the following code snippets correctly achieves this?

  1. A

    df[df['Score'] > 75]

  2. B

    df.groupby('Department').filter(lambda x: x['Score'].mean() > 75)

  3. C

    df[df.groupby('Department')['Score'].transform('mean') >= 75]

  4. D

    df.groupby('Department').apply(lambda x: x[x['Score'] > 75])

Show answer

Correct answer

  • B

    df.groupby('Department').filter(lambda x: x['Score'].mean() > 75)

Question 2

+4 marksOne correct option

How many features remain in X_new after the transformation?

  1. A

    0

  2. B

    1

  3. C

    2

  4. D

    3

Show answer

Correct answer

  • B

    1

Question 3

+4 marksOne correct option

Determine the output of the following text preprocessing pipeline:

  1. A

    ['red','blue','green','yellow']

  2. B

    ['blue' 'red','yellow']

  3. C

    ['blue' 'red']

  4. D

    ['red','blue','green']

Show answer

Correct answer

  • C

    ['blue' 'red']

Question 4

+4 marksOne correct option

Four data points are given: A=(1,1), B=(2,2), C=(8,8), D=(10,10) A hierarchical agglomerative clustering algorithm using single linkage and Euclidean distance is applied. Initially, each point is considered as an individual cluster. Which two clusters will be merged in the first step?

  1. A

    A and B

  2. B

    C and D

  3. C

    A and D

  4. D

    B and C

Show answer

Correct answer

  • A

    A and B

Question 5

+4 marksOne correct option

A genre-based content recommender uses the 19 one-hot genre columns of each movie:

Which of the following statements is TRUE?

  1. A
  2. B
  3. C

    Because the genre vectors are binary, two movies that share no genre still receive a positive cosine similarity.

  4. D
Show answer

Correct answer

  • B

Question 6

+3 marksNumerical answer

What is the output of the following preprocessing pipeline code? (Round off to 2 decimal places if applicable)

Show answer

Correct answer: 2.50

Question 7

+3 marksNumerical answer

Suppose the orginal dataset has 10 rows (1 to 10) Which row/rows of the dataset will be printed if the following code is executed?

Enter the line number (1,2...,10) of the printed row.
If multiple lines are printed enter the sum of the row numbers (i.e. if line 1 and 2 are printed enter 3)

Show answer

Correct answer: 7

Question 8

+3 marksNumerical answer
Show answer

Correct answer: -1.45 (accepted within ±0.15)

Question 9

+3 marksNumerical answer

Consider a 3 class classification problem where the training dataset contains 10 features. The given model is trained on the dataset.
What is the output of the code given below?

Show answer

Correct answer: 4

Question 10

+3 marksNumerical answer

Assume both models in the code given below are fit on the same dataset (X_train) containing 10 features.

Enter the difference between the total number of learnable parameters in both the models. (Enter the absolute value of the difference)

Show answer

Correct answer: 1

Question 11

+3 marksNumerical answer

What is the output of the following code? (Round Upto one decmimal) X = [[0], [1], [2], [3]] y = [0, 0, 1, 1] from sklearn.neighbors import RadiusNeighborsRegressor neigh = RadiusNeighborsRegressor(radius=1.0) neigh.fit(X, y) print(neigh.predict([[1.5]]))

Show answer

Correct answer: 0.5

Question 12

+4 marksNumerical answer
Show answer

Correct answer: 5.50

Question 13

+4 marksNumerical answer

A binary classification model was evaluated on a test set with 500 samples. The model correctly identified 90 positive samples and 360 negative samples. Out of all the samples predicted as positive, 120 were predicted as positive. There were 100 actual positive samples in the dataset. Compute the F1-score of the model. (Round to 2 decimals)

Show answer

Correct answer: 0.815 (accepted within ±0.015)

Question 14

+2 marksOne or more correct options

Select the false statements:

Select all that apply.

  1. A

    StandardScaler ensures the features correspond to a uniform distribution after scaling.

  2. B

    MinMaxScaler ensures that feature values follow a Gaussian Distribution

  3. C

    OridnalEncoder is best for data which contains values corresponding to a Normal Distribution.

  4. D

    Pipeline helps us apply separate transformations to numerical and categorical columns directly.

Show answer

Correct answers

  • A

    StandardScaler ensures the features correspond to a uniform distribution after scaling.

  • B

    MinMaxScaler ensures that feature values follow a Gaussian Distribution

  • C

    OridnalEncoder is best for data which contains values corresponding to a Normal Distribution.

  • D

    Pipeline helps us apply separate transformations to numerical and categorical columns directly.

Question 15

+2 marksOne or more correct options

Which of the following metrics have their lower bound as 0?

Select all that apply.

  1. A

    Accuracy

  2. B

    F1-Score

  3. C

    R2-Score

  4. D

    Mean_Squared_Error

  5. E

    Precision

Show answer

Correct answers

  • A

    Accuracy

  • B

    F1-Score

  • D

    Mean_Squared_Error

  • E

    Precision

Question 16

+3 marksOne or more correct options

Select all that apply.

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

Correct answers

  • A
  • B
  • D

Question 17

+3 marksOne or more correct options

Consider the following implementation of PCA:

Which of the following are correct?

Select all that apply.

  1. A

    X_pca.shape[1] is equal to the original number of features.

  2. B

    The sum of pca.explained_variance_ratio_ is at least 0.95.

  3. C

    len(pca.explained_variance_ratio_) is equal to X_pca.shape[1].

  4. D

    The principal components correspond to the original features with the highest variance.

Show answer

Correct answers

  • B

    The sum of pca.explained_variance_ratio_ is at least 0.95.

  • C

    len(pca.explained_variance_ratio_) is equal to X_pca.shape[1].

Question 18

+3 marksOne correct option

Consider the following two ensemble regression architectures trained on the same dataset:

  1. A

    ensemble1 computes a weighted sum of predictions where later trees have higher weights; ensemble2 takes a simple arithmetic mean of all trees.

  2. B

    ensemble1 reduces variance by averaging independent predictions from 100 trees, meaning increasing n_estimators to 500 will ideally not cause overfitting.

  3. C

    ensemble2 reduces bias sequentially, meaning increasing n_estimators to 500 carries no risk of overfitting.

  4. D

    Both models output predictions by calculating the majority vote across the terminal leaf nodes of all individual base estimators.

Show answer

Correct answer

  • B

    ensemble1 reduces variance by averaging independent predictions from 100 trees, meaning increasing n_estimators to 500 will ideally not cause overfitting.

Question 19

+3 marksOne correct option

Consider the following code snippet:

Which of the following holds true?

  1. A

    The model performs no regularization.

  2. B

    The model performs regularization and the regularization can also perfrom some feature selection.

  3. C

    The model performs regularization and the regularization cant perfrom some feature selection.

  4. D

    The model is very likely to be prone to overfitting

Show answer

Correct answer

  • B

    The model performs regularization and the regularization can also perfrom some feature selection.

Question 20

+3 marksOne correct option

Consider the following assertion and reason. Select the correct option.
Assertion (A): Increasing the number of estimators in AdaBoost can sometimes reduce the test accuracy, even though the training error continues to decrease.
Reason (R): In AdaBoost, after each iteration, the weights of correctly classified training samples are increased so that future weak learners focus more on these correct samples. Choose the correct option:

  1. A

    Both A and R are true, and R is the correct explanation of A.

  2. B

    Both A and R are true, but R is not the correct explanation of A.

  3. C

    A is true, but R is false.

  4. D

    A is false, but R is true.

Show answer

Correct answer

  • C

    A is true, but R is false.

Question 21

+3 marksOne correct option

An email service develops a machine learning model to automatically identify phishing emails.
Any email predicted as phishing is immediately moved to the user's spam folder without notification. A legitimate email incorrectly marked as phishing could cause users to miss important messages, while an actual phishing email that is not detected can still be reported manually by the user.
The company wants to minimize the number of legitimate emails incorrectly classified as phishing.
Which evaluation metric should be given the highest priority while selecting the model?

  1. A

    Accuracy

  2. B

    Precision

  3. C

    Recall

  4. D

    F1-score

Show answer

Correct answer

  • B

    Precision

Question 22

+3 marksOne correct option

Which data augumentation operation is being perfomed on the input image in the given code?

  1. A

    Rotation

  2. B

    Cropping

  3. C

    Magnification

  4. D

    Flipping

Show answer

Correct answer

  • B

    Cropping

Question 23

+3 marksOne correct option

Consider the following code:

Assuming the all the models are trained on the same dataset, which of the models is likely to converge the slowest?

  1. A

    model1

  2. B

    model2

  3. C

    model3

  4. D

    code sinppet for model3 is incorrect

Show answer

Correct answer

  • B

    model2

Question 24

+3 marksOne correct option

A monthly airline-passenger series shows seasonal swings that grow larger as the overall level of the series rises over the years. It is decomposed as:

Which value should fill the blank, and for which reason?

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

Correct answer

  • B

Question 25

+4 marksOne or more correct options

Identify the lines with errors in the given code snippet:

Select all that apply.

  1. A

    There are no errors in the code

  2. B

    Line1

  3. C

    Line2

  4. D

    Line3

Show answer

Correct answers

  • B

    Line1

  • D

    Line3

Question 26

+4 marksOne or more correct options

Select the correct statements regarding the following code snippet:

Select all that apply.

  1. A

    model2 is more likely to have a lower bias and higher variance compared to model1.

  2. B

    Increasing the value of C allowed model2 to penalize misclassification errors more strongly.

  3. C

    model1 must always perform better on the test set because it has lower training accuracy.

  4. D

    The gamma parameter has no effect because the kernel is already set to 'rbf'.

Show answer

Correct answers

  • A

    model2 is more likely to have a lower bias and higher variance compared to model1.

  • B

    Increasing the value of C allowed model2 to penalize misclassification errors more strongly.

Question 27

+4 marksOne or more correct options

A company uses K-Means clustering to divide its customers into 4 groups based on their purchasing behavior. After training the model, the data science team observes the following:
Two different runs of K-Means on the same dataset produce different customer groups. One cluster contains customers that are much farther away from their assigned cluster center compared to other clusters.
Which of the following statements are most likely to explain these observations?

Select all that apply.

  1. A

    K-Means can converge to different solutions because the initial placement of cluster centroids can affect the final clusters.

  2. B

    The cluster with customers far from its centroid may indicate that the chosen value of K does not represent the natural grouping structure of the data.

  3. C

    K-Means guarantees finding the globally optimal clustering solution regardless of initialization.

  4. D

    K-Means assigns clusters by maximizing the distance between points within the same cluster.

Show answer

Correct answers

  • A

    K-Means can converge to different solutions because the initial placement of cluster centroids can affect the final clusters.

  • B

    The cluster with customers far from its centroid may indicate that the chosen value of K does not represent the natural grouping structure of the data.

Question 28

+4 marksOne or more correct options

Identify which of the following lines (marked in comments) contain errors in the given code snippet:

Select all that apply.

  1. A

    Line1

  2. B

    Line2

  3. C

    Line3

  4. D

    Line4

Show answer

Correct answers

  • B

    Line2

  • D

    Line4

Question 29

+5 marksNumerical answer

Using user–user collaborative filtering, the predicted rating is

Show answer

Correct answer: 3.85 (accepted within ±0.05)

Question 30

+2 marksOne correct option

A forecasting model achieves an R2 score of 0.98 on the test set. However, it was trained using a feature that contains the sales value of the next day. Which of the following is the most appropriate conclusion?

  1. A

    The model has low bias.

  2. B

    The model has successfully captured seasonality.

  3. C

    The evaluation is unreliable due to data leakage.

  4. D

    The model has underfit the data.

Show answer

Correct answer

  • C

    The evaluation is unreliable due to data leakage.