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.
For a LinearRegression model with equation assume that the noise term . The model parameters satisfy the constraint A LinearRegression model is trained without intercept as shown below:
What is the value of ? Enter your answer rounded to three decimal places
Consider the following ML task/steps for a regression dataset: 1. Read the data from a file (named ‘dataset.csv’). It has 7 columns. The last column is the target variable, all 6 features numerical. 2. Remove rows which has target values missing. 3. Split the data into training and test sets. Take randomly the 70% of rows in the training set and the rest of them into the test set. 4. Fill the missing values in the features by KNNImputer using 3 nearest neighbours. 5. Train a LinearRegression model on the training set. 6. Report R2 score on the test set. Which of the following code snippets correctly accomplishes the above task? Assume necessary imports.
Consider following two statements: Statement 1: The GaussianNB classifier can incrementally learn using partial_fit. Statement 2: GaussianNB performance suffers when features are dependent, as it assumes independence in calculating conditional probabilities.
You’re designing an ‘MLPClassifier’ for an image recognition task. The dataset consists of grayscale images of animals. You want to introduce non-linearity to the neural network’s architecture. Which element of the neural network architecture would you adjust to incorporate non-linearity in the model?
You’re working on a binary classification task using the ‘MLPClassifier’ to predict whether a customer will make a purchase based on their browsing behavior.You’re concerned about overfitting due to the complexity of the model. You decide to increase the ‘alpha’ parameter to control overfitting. The following code snippet shows the application of ‘MLPClassifier’:
You’re working on a binary classification task using the ‘MLPClassifier’ to predict whether a customer will make a purchase based on their browsing behavior.You’re concerned about overfitting due to the complexity of the model. You decide to increase the ‘alpha’ parameter to control overfitting. The following code snippet shows the application of ‘MLPClassifier’:
Increasing the model’s complexity to fit the training data more closely.
Adding a stronger regularization term to the loss function, discouragingcomplex models.
Making the model more sensitive to outliers and noise in the data.
Adjusting the learning rate to control convergence speed.
Mention which of the following statement(s) is / are correct? Statement 1: Incremental learning is a dynamic technique which is applied when training data becomes available gradually over time or its size is out of system memory limits. Statement 2: Sklearn can not process large data in batches.
Statement 1 is correct but statement 2 is incorrect.
Statement 1 is incorrect but statement 2 is correct.
Mention whether the following statements are TRUE or FALSE . Statement 1 : ‘In order to extend ROC curve and ROC area to multi-label classification, it is necessary to binarize the output.‘ Statement 2: In SGDClassifier, setting warm_start=True does not retain the weight values of the model after max_iter and hence does not produce different results for each execution.‘
Statement 1 is correct but statement 2 is incorrect.
Statement 1 is incorrect but statement 2 is correct.
You have a binary classification problem to solve with following information: 1. All features are numircal. 2. The dataset has size of 80 GB. 3. The data has to be preprocessed. 4. After data preprocessing, train the model with gradient descent or its variations. Which of the following will perform the above task?
Perform one hot encoding followed by training with LogisticRegression model(sklearn.linear_model).
Perform standard scaling followed by asklearn.neighbors.KNeighborsClassifier model.
Perform min-max scaling followed by a sklearn.tree.DecisionTreeClassifiermodel.
Perform max-absolute scaling followed by asklearn.linear_model.SGDClassifier model.
Brajesh wants to tune hyper parameters of an AdaBoost model for a classification problem with following specifications: 1. Base estimator as Decision trees classifier with max_depth=1. 2. Number of estimators range from 30 to 40 (both inclusive) at the interval of 1. 3. Cross validation = 5. 4. Learning rate must vary between 0.2 to 2.0 (both inclusive) at the intervals of 0.2. 5. Train the best model on the entire training set. 6. Print score on test set. Which of the following code blocks will correctly execute Brajesh’s task? [Note: Assume necessary imports and variables for training and test sets.]
Mention which of the following statement(s) is / are correct? 1. Statement 1: Incremental learning is a dynamic technique which is applied when training data becomes available gradually over time or its size is out of system memory limits. 2. Statement 2: Sklearn can process large data in batches and updates the model parameters for each batch.
Statement 1 is correct but statement 2 is incorrect.
Statement 1 is incorrect but statement 2 is correct.
Consider following statements: 1. Statement 1 : In order to extend ROC curve and ROC area to multi-label classification, it is necessary to binarize the output. 2. Statement 2: In SGDClassifier, setting warm_start=True retains the weight values of the model after max_iter and hence produce different results for each execution. Choose the correct option:
Statement 1 is correct but statement 2 is incorrect.
Statement 1 is incorrect but statement 2 is correct.
You have a regression problem to solve with following information: 1. All features are numerical. 2. The dataset has size of 40 GB. 3. The data has to be preprocessed. 4. After data preprocessing, train the model with gradient descent or its variations. Which of the following will perform the above task?
Perform one hot encoding followed by training with LinearRegression model(from sklearn.linear_model).
Perform standard scaling followed by training with KNeighborsRegressormodel (from sklearn.neighbors).
Perform min-max scaling followed by training with DecisionTreeRegressormodel (from sklearn.tree).
Perform min-max scaling followed by training with SGDRegressor model (fromsklearn.linear_model).
Consider the following code and select the correct options. (Note: Assume necessary imports.)
Consider the following code and select the correct options. (Note: Assume necessary imports.)
Scaled data have values in between [0, 1].
Regressor has three hidden layers.
Regressor has 150 hidden layers.
Regressor applies stochastic gradient decent to update the weights.
Rajesh wants to tune hyper parameters of an AdaBoost model for a classification problem with following specifications: 1. Base estimator as Decision trees classifier with max_depth=1. 2. Number of estimators range from 10 to 20 (both inclusive) at the interval of 1. 3. Cross validation =4. 4. Learning rate must vary between 0.1 to 1.0 (both inclusive) at the intervals of 0.1. 5. Train the best model on the entire training set. 6. Print score on test set. Which of the following code blocks will correctly execute Rajesh’s task? [Note: Assume necessary imports and variables for training and test sets.]
Which of the following code blocks will correctly train a large scale regression model using partial_fit, if shape of X_train,Y_train are given as (8000,900,10) and (8000,900) respectively. Note that the dataset has been transformed into batches of size 900 each?