60 questions pulled from past papers whose wording matches this week's topics, newest first, duplicates removed. Pick your answers, then press Check answers. Figures and answer keys are the originals.
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?
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.
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.
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).
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.
Consider the following two ensemble regression architectures trained on the same dataset:
How do these two models differ in their output strategy to produce the final prediction for a given test instance, and how does adding more estimators affect them?
ensemble1 computes a weighted sum of predictions where later trees have higher weights; ensemble2 takes a simple arithmetic mean of all trees.
ensemble1 reduces variance by averaging independent predictions from 100 trees, meaning increasing n_estimators to 500 will ideally not cause overfitting.
ensemble2 reduces bias sequentially, meaning increasing n_estimators to 500 carries no risk of overfitting.
Both models output predictions by calculating the majority vote across the terminal leaf nodes of all individual base estimators.
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?
Consider the given 2 different lasso regression models trained on the same dataset:
Statements: 1. The coefficients of lasso2 are more likely to be smaller in magnitude than those of lasso1. 2. lasso1 may have fewer zero coefficients than lasso2. 3. The predictions of lasso1 on the training data will exactly match y. 4. Increasing alpha always increases model accuracy on unseen data. Which of the given statements are correct?
The following code attempts to implement Ridge regression on the Boston housing dataset but contains an error. The missing part should be correctly filled in to avoid issues during training.
The following code attempts to implement Ridge regression on the Boston housing dataset but contains an error. The missing part should be correctly filled in to avoid issues during training.
Which of the following correctly fills the missing part while ensuring proper preprocessing?
Suppose we want to transform features in a dataset using polynomial transformation. The sklearn API provides the functionality in which of the following modules?
Consider the given Table 1: Banking data for the given subquestions stored as pandas dataframe in variable df
Consider the given Table 1: Banking data for the given subquestions stored as pandas dataframe in variable df
Based on the above data, answer the given subquestions.
In Contact column which of the following statistical measures can be used to replace nan values?
Consider the Ridge regression model in scikit-learn, represented by the Ridge class. Which of the following statements about Ridge regression is correct?
Ridge regression is designed to handle class imbalance of the dataset.
The regularization term in Ridge regression is added to the sum of absoluteresiduals.
Increasing the value of the regularization parameter (alpha) in Ridgeregression makes the model less sensitive to high-magnitude coefficients.
Ridge regression is equivalent to Lasso regression when the regularizationparameter (alpha) is set to zero.
The training may terminate after 499 iterations or lesser
the classifier represents a perceptron model
The classifier’s model parameters will initialized with parameters learnt fromprevious call to fit() function, if the same object is trained/fitted multiple times on new data.
When using a Support Vector Classifier (SVC) in scikit-learn with different values of the regularization parameter (C), how does the complexity of the decision boundary change? Select all correct statements:
Smaller values of C result in a more complex decision boundary.
Larger values of C result in a more complex decision boundary.
The decision boundary becomes simpler with increasing values of C.
The pipeline will generate polynomial features (including squared terms) andthen scale these features to a range between 0 and 1.
The transformed data will consist of the original features, their squares, andinteraction terms, all scaled between 0 and 1.
The pipeline scales the original features between 0 and 1, then subsequentlygenerates polynomial combinations including both square terms and interaction terms.
Only interaction terms between features are generated by the pipeline, whichare then scaled between 0 and 1, without including the squared terms of individual features.