MauryaHub PYQ Practice

Machine Learning Practice · End Term · May 2026 · AN

Machine Learning Practice · End Term · May 2026 AN

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

0 / 29 published solutions

Question 2 MCQ · 4.0 marks

Analyze the following code block:
Source diagram or notation
Which products are included in filtered_df?
A.
Laptop, Mouse, Monitor
B.
Mouse, Keyboard
C.
Laptop, Mouse
D.
Laptop, Mouse, Cable

A published solution is not available for this question yet.

Report a correction for Q2

Question 3 MCQ · 4.0 marks

In the following question an Assertion (A) is followed by a Reason (R). Choose the correct option. **Assertion (A):** In a scikit-learn
Source diagram or notation
, the last step must be a transformer that implements both
Source diagram or notation
and
Source diagram or notation
. **Reason (R):** Only the intermediate steps of a
Source diagram or notation
are required to implement
Source diagram or notation
; the final estimator only needs to implement
Source diagram or notation
.
A.
Both A and R are true, and R is the correct explanation of A
B.
Both A and R are true, but R is not the correct explanation of A
C.
A is true, but R is false
D.
A is false, but R is true
E.
Both A and R are false

A published solution is not available for this question yet.

Report a correction for Q3

Question 4 MCQ · 4.0 marks

Consider the following code:
Source diagram or notation
After the model is fit
Source diagram or notation
raises an error. Why?
A.
VotingRegressor deletes the original estimator.
B.
VotingRegressor internally clones every estimator before fitting.
C.
LinearRegression does not store coefficients.
D.
VotingRegressor converts all models to RandomForest since it is the best model out of the 3 due to ensemble learning.

A published solution is not available for this question yet.

Report a correction for Q4

Question 5 MCQ · 4.0 marks

A news article dataset contains 10,000 documents. The word "government" appears in 9,500 documents, while the word "cryptocurrency" appears in only 200 documents. A TF-IDF vectorizer is applied to this dataset. Which of the following statements is most likely true?
A.
The TF value of "government" will always be lower than the TF value of "cryptocurrency" because it appears in more documents.
B.
The IDF contribution of "cryptocurrency" will be higher than that of "government", even if both words occur the same number of times in a document.
C.
If "government" appears 50 times in one article, its TF-IDF score must be higher than "cryptocurrency" appearing once in the same article.
D.
Removing "government" from the vocabulary will always decrease model performance because it appears in most documents.

A published solution is not available for this question yet.

Report a correction for Q5

Question 6 MCQ · 4.0 marks

What is being done to the input image in the given code?
Source diagram or notation
A.
The image has been rotated by 90 degrees clockwise.
B.
The image has been vertically flipped.
C.
The image has been horizontally flipped.
D.
The image has been mean centered.

A published solution is not available for this question yet.

Report a correction for Q6

Question 7 MCQ · 4.0 marks

A matrix-factorization recommender is set up on MovieLens-100k as follows:
Source diagram or notation
Which of the following statements is **TRUE**?
A.
Evaluating the expression
Source diagram or notation
returns the full predicted-rating matrix, of shape
Source diagram or notation
.
B.
The model has
Source diagram or notation
trainable parameters.
C.
Increasing
Source diagram or notation
reduces the risk of overfitting on the sparse rating matrix.
D.
The predicted rating of user
Source diagram or notation
for item
Source diagram or notation
is the cosine similarity between
Source diagram or notation
and
Source diagram or notation
.

A published solution is not available for this question yet.

Report a correction for Q7

Question 8 MCQ · 4.0 marks

Which statement correctly pairs each test's null hypothesis with its decision rule?
A.
ADF: H0 = non-stationary, conclude stationary if p < 0.05. KPSS: H0 = (trend) stationary, conclude non-stationary if p < 0.05.
B.
ADF: H0 = stationary, conclude non-stationary if p < 0.05. KPSS: H0 = non- stationary, conclude stationary if p < 0.05.
C.
Both ADF and KPSS have H0 = non-stationary; both conclude stationary when p < 0.05.
D.
Both ADF and KPSS have H0 = stationary; both conclude non-stationary when p < 0.05.

A published solution is not available for this question yet.

Report a correction for Q8

Question 9 NAT · 3.0 marks

What is the output of the given code?
Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q9

Question 10 NAT · 3.0 marks

Source diagram or notation
Source diagram or notation
applies both transformers in parallel and concatenates their outputs side-by-side. How many columns does
Source diagram or notation
have? (Enter an integer)

A published solution is not available for this question yet.

Report a correction for Q10

Question 11 NAT · 3.0 marks

What is the output of the following code? import pandas as pd from sklearn.preprocessing import OneHotEncoder df = pd.DataFrame({ "Color": ["Red", "Blue", "Green", "Blue", "Red"], "Size": ["S", "M", "L", "XL", "M"] }) encoder = OneHotEncoder(drop="first", sparse_output=False) X = encoder.fit_transform(df) print(X.shape[1])

A published solution is not available for this question yet.

Report a correction for Q11

Question 12 NAT · 3.0 marks

What is the output of the given code? (Round upto one decimal)
Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q12

Question 13 NAT · 3.0 marks

A K-Means algorithm has a cluster centroid: C=(6,6) During the next iteration, a new data point: (10,10) is assigned to this cluster. Before the update step, this cluster contained 4 data points. The individual points are not available, but the centroid of the cluster before adding the new point was: (6,6) After adding the new point and performing the centroid update step, the new centroid becomes: (6.8,6.8) What is the sum of the coordinates of the original 4 data points combined?

A published solution is not available for this question yet.

Report a correction for Q13

Question 14 NAT · 4.0 marks

Source diagram or notation
After scaling, what is the SUM of the transformed values of all samples whose ORIGINAL value equals 4? (Enter up to 2 decimals)

A published solution is not available for this question yet.

Report a correction for Q14

Question 15 NAT · 4.0 marks

A regression model achieves an R\(^{2}\) score of 0.92 on a test set. The sum of squared deviations of the true target values from their mean is 625. Compute the sum of squared prediction errors made by the model.

A published solution is not available for this question yet.

Report a correction for Q15

Question 16 NAT · 4.0 marks

What is the output of the print statement in the given code? Enter an integer
Source diagram or notation

A published solution is not available for this question yet.

Report a correction for Q16

Question 17 MSQ · 3.0 marks

The following categorical-encoding transformers are available in scikit-learn:
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
,
Source diagram or notation
. Select ALL statements that are correct.
A.Source diagram or notation
can transform only 1-D data, whereas
Source diagram or notation
can operate on multi-dimensional (multi-feature) data.
B.
By default (with no dropping),
Source diagram or notation
creates K binary columns for a feature with K distinct categories.
C.Source diagram or notation
is designed to encode samples where each sample is associated with a set of labels.
D.Source diagram or notation
is preferred over
Source diagram or notation
for nominal (unordered) categories because it prevents the model from assuming any ordering among the categories.

A published solution is not available for this question yet.

Report a correction for Q17

Question 18 MSQ · 3.0 marks

Consider the following code:
Source diagram or notation
Which of the following are correct?
A.
X_new contains exactly 5 features.
B.
selector.support_.sum() is equal to 5.
C.
RFE selects the first 5 columns of X.
D.
RFE repeatedly removes the least important features according to the estimator.

A published solution is not available for this question yet.

Report a correction for Q18

Question 19 MSQ · 3.0 marks

In the given code snippet certain lines are marked with comments. Identify which of those lines dont have any errors.
Source diagram or notation
A.
Line1
B.
Line2
C.
Line3
D.
Line4

A published solution is not available for this question yet.

Report a correction for Q19

Question 20 MSQ · 3.0 marks

Which of the following parameters of a DecisionTreeClassifier in Sklearn can be adjusted if the model has a high varience?
A.
ccp_alpha
B.
random_state
C.
min_samples_split
D.
max_depth

A published solution is not available for this question yet.

Report a correction for Q20

Question 21 MSQ · 3.0 marks

Which of the following statements comparing **STL** decomposition with **classical**
Source diagram or notation
are correct?
A.
STL can adapt to a seasonal pattern whose shape changes slowly over time, whereas classical decomposition assumes a fixed seasonal component.
B.
STL, being based on LOESS smoothing, is more robust to outliers than classical decomposition.
C.
Classical decomposition supports only additive models, while STL supports both additive and multiplicative models.
D.
Classical
Source diagram or notation
can be run in either additive or multiplicative mode.

A published solution is not available for this question yet.

Report a correction for Q21

Question 22 MSQ · 4.0 marks

Consider two regularization models, Model A (Ridge) and Model B (Lasso), trained on a dataset where two input features are highly collinear ( X1≈X2 ).
Source diagram or notation
Which of the following statements accurately describe the expected behavior of these models and their evaluation metrics under severe collinearity?
A.
Model B (Lasso) will distribute the regression coefficients evenly across both X1 and X2 to balance the penalty, while Model A (Ridge) will force one of the coefficients to be exactly zero.
B.
Model A (Ridge) will shrink the coefficients of X1 and X2 toward zero but keep them roughly equal, whereas Model B (Lasso) will unstablely select one feature to keep and drive the coefficient of the other exactly to zero.
C.
If the target variable y contains extreme outliers, evaluating these models using Mean Squared Error (MSE) will penalize those large errors more heavily than Mean Absolute Error (MAE).
D.
Minimizing the MSE loss function during the training of Model A and Model B mathematically guarantees that the sum of the residual errors ( y−ŷ ) will always equal zero.

A published solution is not available for this question yet.

Report a correction for Q22

Question 23 MSQ · 4.0 marks

Consider the following code:
Source diagram or notation
Select the correct statements:
A.
The algorithm starts by selecting two random centroids and iteratively updates them.
B.
The algorithm initially treats every point as a separate cluster and repeatedly merges clusters based on the complete linkage criterion.
C.
The final labels represent the two groups formed after cutting the dendrogram to obtain two clusters.
D.
Changing n_clusters=2 to n_clusters=3 will change the entire merging process from the first step.
E.
The output labels will always be [0,0,0,1,1] because the first three points are closer to each other.

A published solution is not available for this question yet.

Report a correction for Q23

Question 24 MCQ · 3.0 marks

Consider the following models:
Source diagram or notation
Which of the following explains the two models correctly?
A.
model1 will apply weaker regularization compared to model2, resulting in smaller coefficients.
B.
model2 will apply stronger regularization compared to model1, resulting in more coefficients close to zero.
C.
model1 is more likely to have smaller magnitude coefficients because it uses stronger regularization.
D.
Both models apply the same amount of regularization because the penalty type is the same.

A published solution is not available for this question yet.

Report a correction for Q24

Question 25 MCQ · 3.0 marks

In the following question an Assertion (A) is followed by a Reason (R). Choose the correct option. Assertion (A): The order in which training samples are presented to the Perceptron can affect the final learned weight vector, even when the training data is linearly separable. Reason (R): If a dataset is linearly separable, the Perceptron algorithm is guaranteed to converge after a finite number of weight updates.
A.
Both A and R are true, and R is the correct explanation of A.
B.
Both A and R are true, but R is not the correct explanation of A.
C.
A is true, but R is false.
D.
A is false, but R is true.

A published solution is not available for this question yet.

Report a correction for Q25

Question 26 MCQ · 3.0 marks

What evaluation metric does code the compute?
Source diagram or notation
A.
R2 Score
B.
Recall
C.
Accuracy
D.
Precision
E.
F1 Score

A published solution is not available for this question yet.

Report a correction for Q26

Question 27 MCQ · 3.0 marks

A hospital develops a machine learning model to identify patients who may have a rare but life- threatening disease. Only about 1% of patients actually have the disease. Every patient predicted as positive is referred for an inexpensive follow-up blood test. However, missing an actual patient with the disease could delay treatment and have severe consequences. Which evaluation metric should be given the highest priority while selecting the model?
A.
Accuracy
B.
Precision
C.
Recall
D.
F1-score

A published solution is not available for this question yet.

Report a correction for Q27

Question 28 MCQ · 3.0 marks

After training a KMeans clustering algorithm on a dataset we find a data point is sitting exactly on or extremely close to the decision boundary between two neighboring clusters. Which of the following values will the silhouette score be close / equal to?
A.
1
B.
0
C.
-1
D.
infinity

A published solution is not available for this question yet.

Report a correction for Q28

Question 29 MCQ · 2.0 marks

The decision rule for a Naive Bayes varient is based on the following formula:
Source diagram or notation
Identify the Naive Bayes varient.
A.
GaussianNB
B.
BernoulliNB
C.
CategoricalNB
D.
MultinomialNB

A published solution is not available for this question yet.

Report a correction for Q29

Question 30 NAT · 5.0 marks

Consider the following **item–user** rating matrix (rows = items, columns = users; a
Source diagram or notation
means not rated):
Source diagram or notation
Using **item–item collaborative filtering**, the predicted score for an item the user has not rated is
Source diagram or notation
where
Source diagram or notation
are the cosine similarities of the target item to the items the user **has** rated, and
Source diagram or notation
are the corresponding ratings by that user. Predict the rating that user **U4** would give to item **I4**. (Answer up to 2 decimals.)

A published solution is not available for this question yet.

Report a correction for Q30