Home / Study library / Machine Learning Practice / End Term · Sep 2025 Machine Learning Practice · End Term · Sep 2025 · AN
Machine Learning Practice · End Term · Sep 2025 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 / 30 published solutions
Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 Q23 Q24 Q25 Q26 Q27 Q28 Q29 Q30 Q31
Question 2 MCQ · 2.0 marks The adfuller() function in statsmodels is used to test:
A. Whether a time series has seasonal patterns
B. Whether a time series is stationary
C. Whether the data follows a normal distribution
D. Whether the variance of the data changes over time
A published solution is not available for this question yet.
Report a correction for Q2
Question 3 MCQ · 2.0 marks
What will typically happen if **series_with_nans** contains NaNs (null values) ?
A. statsmodels will automatically impute NaNs and fit silently.
B. fit() will raise an error or drop NaNs depending on the estimator; user should
handle NaNs beforehand.
C. NaNs are treated as zeros.
D. The model will only use the NaN values to estimate variance.
A published solution is not available for this question yet.
Report a correction for Q3
Question 4 MCQ · 1.0 marks A newly launched movie has no ratings, but metadata such as genre, cast, and director is
available. Which algorithm can still recommend it?
A. User-based Collaborative Filtering
B. Item-based Collaborative Filtering
C. Content-based filtering
D. Matrix factorization without regularization
A published solution is not available for this question yet.
Report a correction for Q4
Question 5 MCQ · 2.0 marks Performing singular value decomposition on a user-item matrix aims to:
A published solution is not available for this question yet.
Report a correction for Q5
Question 6 MCQ · 2.0 marks Which of the following can be used to evaluate the outputs of the KNNClassifier?
A. Negative Mean Absolute Error
A published solution is not available for this question yet.
Report a correction for Q6
Question 7 NAT · 2.0 marks What is the output of the following standard scaler transformation?
A published solution is not available for this question yet.
Report a correction for Q7
Question 8 NAT · 1.0 marks What is the value of recall score computed in the following code? (Enter upto 2 decimals)
A published solution is not available for this question yet.
Report a correction for Q8
Question 9 MSQ · 2.0 marks Which of the following algorithms **don't** get impacted by feature scaling?
A published solution is not available for this question yet.
Report a correction for Q9
Question 10 NAT · 2.0 marks Consider the following data preprocessing code. What are the number of zero(s) in the
transformed labels vector after applying label encoding?
A published solution is not available for this question yet.
Report a correction for Q10
Question 11 MCQ · 1.0 marks What does metric in the following code measure?
A published solution is not available for this question yet.
Report a correction for Q11
Question 12 NAT · 1.0 marks Compute cosine similarity for the two items which have feature vectors as given below (rounded
to 2 decimals).
A published solution is not available for this question yet.
Report a correction for Q12
Question 13 MCQ · 2.0 marks Identify the datatypes of the two datasets given below:
(Assume all library imports are correctly done)
A published solution is not available for this question yet.
Report a correction for Q13
Question 14 MCQ · 1.0 marks Which of the following statements about Hierarchical Agglomerative Clustering is TRUE?
A. It starts with all data points in a single cluster and recursively splits them.
B. It requires the number of clusters to be specified before training.
C. It repeatedly merges the two closest clusters until a stopping condition is met.
D. It updates cluster centroids after each merge.
A published solution is not available for this question yet.
Report a correction for Q14
Question 15 MCQ · 1.0 marks You are using a ColumnTransformer to preprocess a dataset before training a model:
What will be the shape of the transformed matrix X?
A published solution is not available for this question yet.
Report a correction for Q15
Question 16 NAT · 2.0 marks A published solution is not available for this question yet.
Report a correction for Q16
Question 17 NAT · 2.0 marks You are given the following dataset and model:
What is the value of prediction after running this code?
A published solution is not available for this question yet.
Report a correction for Q17
Question 18 MSQ · 2.0 marks For the RandomForestClassifier select the correct pair(s) of parameter(s) and their explanation(s).
A. n_estimators – Number of trees in the RandomForestClassifier
B. max_depth – Maximum depth allowed for each decision tree
C. min_samples_leaf – Controls the maximum number of trees that will be
created
D. bootstrap – Sets the number of features used for splitting at each node
A published solution is not available for this question yet.
Report a correction for Q18
Question 19 MCQ · 1.0 marks What is the output of the following code?
A. B. C. D. A published solution is not available for this question yet.
Report a correction for Q19
Question 20 MCQ · 2.0 marks Consider the following code snippet. Assume that all required libraries have been imported
correctly.
A practitioner observes that each time the **fit()** method is called on **clf**, the model is trained from
scratch and the parameters learned in the previous training call are discarded.
Which of the following changes should be made so that the model continues training from the
previously learned parameters when **fit()** is called again?
B. Combine training data from all training sessions into a single dataset
C. Set retain_parameters=True
D. This behavior cannot be changed for Perceptron
A published solution is not available for this question yet.
Report a correction for Q20
Question 21 MCQ · 1.0 marks Consider the following cases for splitting train and test data for some real world dataset.
Which of the following hold true?
A. The selected samples(rows) in X_train will always be same for all the cases.
B. The selected samples(rows) in X_train will always be different for all the cases.
C. The selected samples(rows) in X_train will always be different for case 1 and
case 2.
D. The selected samples(rows) in X_train will always be different for case 1 and
case 3.
A published solution is not available for this question yet.
Report a correction for Q21
Question 22 NAT · 2.0 marks You are performing hyperparameter tuning using GridSearchCV for a machine learning model.
The following parameter grid is provided:
How many unique hyperparameter combinations will GridSearchCV evaluate in total?
A published solution is not available for this question yet.
Report a correction for Q22
Question 23 MCQ · 1.0 marks You are using make_blobs to generate synthetic data for clustering:
What will the output of the above clustering show?
A. One cluster containing all points.
B. It will raise an error since n_samples is not divisible by centers
C. Two clusters, but not necessarily equal-sized; distribution of samples per
cluster may vary.
D. Two clusters with exactly 4 points each.
A published solution is not available for this question yet.
Report a correction for Q23
Question 24 MCQ · 2.0 marks What does the following pandas code do ?
A. All rows where Age < 18, sorted by Marks, index unchanged.
B. Only rows where Marks > 60, sorted by Age, and index reset.
C. All rows sorted first by Marks, then by Age.
D. Drops the Age column and sorts remaining data.
A published solution is not available for this question yet.
Report a correction for Q24
Question 25 MCQ · 2.0 marks What does the parameter hidden_layer_sizes=(50, 30) represent in both MLPClassifier and
MLPRegressor?
A. 50 input features and 30 output units
B. Two hidden layers with 50 and 30 neurons respectively
C. 50 epochs and 30 batches
D. 50 samples per batch and 30 iterations
A published solution is not available for this question yet.
Report a correction for Q25
Question 26 MCQ · 1.0 marks What is the role of the alpha=1.0 parameter in the given sklearn code to build a regression model?
A. It applies L1 regularization and sets some coefficients to zero.
B. It removes regularization completely and behaves like Linear Regression.
C. It adds L2 regularization that penalizes large coefficients to prevent
overfitting.
D. It makes the model ignore the intercept term.
A published solution is not available for this question yet.
Report a correction for Q26
Question 27 NAT · 2.0 marks What is the output of the following code?
A published solution is not available for this question yet.
Report a correction for Q27
Question 28 MSQ · 2.0 marks Which of the following is a hyper parameter?
A. "intercept_" in LinearRegression
B. "degree" in PolynomialFeatures
C. "n_neighbors" in KNeighborsClassifier
D. "max_depth" in DecisionTreeClassifier
A published solution is not available for this question yet.
Report a correction for Q28
Question 29 MSQ · 2.0 marks Consider the following code snippet that trains a Decision Tree classifier using scikit-learn:
A node in the trained decision tree is split only if **both** of the following conditions are satisfied:
• The node contains at least **min_samples_split** samples.
• Each child node created after the split contains at least **min_samples_leaf** samples.
Assume node (N) is a non-leaf node being considered for splitting.
In which of the following cases **will the split at node (N) be allowed**?
A. Node (N) contains 15 samples. After splitting, the left child has 9 samples and
the right child has 6 samples.
B. Node (N) contains 6 samples. After splitting, the left child has 4 samples and
the right child has 2 samples.
C. Node (N) contains 12 samples. After splitting, the left child has 3 samples and
the right child has 9 samples.
D. Node (N) contains 8 samples. After splitting, the left child has 4 samples and
the right child has 4 samples.
A published solution is not available for this question yet.
Report a correction for Q29
Question 30 MCQ · 2.0 marks Consider the following ensemble model built using **VotingClassifier** with **voting='soft'**:
How is the final prediction for a test sample obtained?
A. By selecting the most common predicted class.
B. By averaging predicted class probabilities.
C. By summing the predicted class labels.
D. By choosing the most accurate classifier.
A published solution is not available for this question yet.
Report a correction for Q30
Question 31 MCQ · 2.0 marks You are given a dataset where each row represents a customer using two numerical features. You
apply K-means clustering with K=3 clusters using the following code:
What does the variable **labels** represent after the model is fitted?
A. The values of the input features used for clustering.
B. The cluster index assigned to each data point.
C. The total number of clusters formed.
D. The coordinates of the cluster centroids.
A published solution is not available for this question yet.
Report a correction for Q31