Question 1 | MCQ
THIS IS QUESTION PAPER FOR THE SUBJECT "DIPLOMA LEVEL : MACHINE LEARNING PRACTICE
(COMPUTER BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
(COMPUTER BASED EXAM)"
ARE YOU SURE YOU HAVE TO WRITE EXAM FOR THIS SUBJECT?
CROSS CHECK YOUR HALL TICKET TO CONFIRM THE SUBJECTS TO BE WRITTEN.
(IF IT IS NOT THE CORRECT SUBJECT, PLS CHECK THE SECTION AT THE TOP FOR THE SUBJECTS REGISTERED BY YOU)
Solution
Analyze the following code block:

Which products are included in filtered_df?
Which products are included in filtered_df?
Solution
In the following question an Assertion (A) is followed by a Reason (R). Choose the correct option.
Assertion (A): In a scikit-learn
, the last step must be a transformer that implements both
and
.
Reason (R): Only the intermediate steps of a
are required to implement
; the final estimator only needs to implement
.
Assertion (A): In a scikit-learn
Reason (R): Only the intermediate steps of a
Solution
Consider the following code:

After the model is fit
raises an error. Why?
After the model is fit
Solution
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 TF-IDF vectorizer is applied to this dataset.
Which of the following statements is most likely true?
Solution
What is being done to the input image in the given code?

Solution
A matrix-factorization recommender is set up on MovieLens-100k as follows:

Which of the following statements is TRUE?
Which of the following statements is TRUE?
Solution
Which statement correctly pairs each test's null hypothesis with its decision rule?
Solution
Inscript
What is the output of the given code?

What is the output of the given code?
Solution
Inscript

applies both transformers in parallel and concatenates their outputs side-by-side. How many columns does
have? (Enter an integer)
Solution
Inscript
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])
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])
Solution
Inscript
What is the output of the given code? (Round upto one decimal)

What is the output of the given code? (Round upto one decimal)
Solution
Inscript
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 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?
Solution
Inscript

After scaling, what is the SUM of the transformed values of all samples whose ORIGINAL value equals 4? (Enter up to 2 decimals)
After scaling, what is the SUM of the transformed values of all samples whose ORIGINAL value equals 4? (Enter up to 2 decimals)
Solution
Inscript
A regression model achieves an R2 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 regression model achieves an R2 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.
Solution
Inscript
What is the output of the print statement in the given code? Enter an integer

What is the output of the print statement in the given code? Enter an integer
Solution
The following categorical-encoding transformers are available in scikit-learn:
,
,
,
. Select ALL statements that are correct.
Solution
Consider the following code:

Which of the following are correct?
Which of the following are correct?
Solution
In the given code snippet certain lines are marked with comments. Identify which of those lines dont have any errors.

Solution
Which of the following parameters of a DecisionTreeClassifier in Sklearn can be adjusted if the model has a high varience?
Solution
Which of the following statements comparing STL decomposition with classical
are correct?
Solution
Consider two regularization models, Model A (Ridge) and Model B (Lasso), trained on a dataset where two input features are highly collinear ( X1≈X2 ).

Which of the following statements accurately describe the expected behavior of these models and their evaluation metrics under severe collinearity?
Which of the following statements accurately describe the expected behavior of these models and their evaluation metrics under severe collinearity?
Solution
Consider the following code:

Select the correct statements:
Select the correct statements:
Solution
Consider the following models:

Which of the following explains the two models correctly?
Which of the following explains the two models correctly?
Solution
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.
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.
Solution
What evaluation metric does code the compute?

Solution
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?
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?
Solution
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?
Which of the following values will the silhouette score be close / equal to?
Solution
The decision rule for a Naive Bayes varient is based on the following formula:

Identify the Naive Bayes varient.
Identify the Naive Bayes varient.
Solution
Inscript
Consider the following item–user rating matrix (rows = items, columns = users; a
means not rated):

Using item–item collaborative filtering, the predicted score for an item the user has not rated is

where
are the cosine similarities of the target item to the items the user has rated, and
are the corresponding ratings by that user.
Predict the rating that user U4 would give to item I4. (Answer up to 2 decimals.)
Consider the following item–user rating matrix (rows = items, columns = users; a
Using item–item collaborative filtering, the predicted score for an item the user has not rated is
where
Predict the rating that user U4 would give to item I4. (Answer up to 2 decimals.)
Solution
Shape
Thickness [ / ]
3
All colors