50 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.
Assume that for a certain linear regression problem involving features, the following weight vectors all produce an equal mean squared error: Which of the weight vectors is likely to be chosen by ridge regression?
Consider the following dataset with two binary features and binary label :
Consider the following three claims about this dataset: (i) Logistic regression (using the raw features , with or without a bias term) can achieve zero training error. (ii) A decision tree of depth at most , using axis-aligned splits on , can achieve zero training error. (iii) -nearest-neighbour, evaluated on this training set, achieves zero training error. Consider each point is its own nearest neighbour. Select the option that lists exactly the claims that are true.
Suppose the dataset is initially linearly separable. Later, the data-generating process changes and the class boundary becomes highly nonlinear, for example: for one class and for the other. Without manually creating nonlinear features, which classifier among the three is most naturally capable of representing this type of decision boundary?
Suppose the true data-generating process is a polynomial of degree . You fit three models to the data: linear regression, polynomial regression of degree , and polynomial regression of degree . Which option correctly characterizes the bias and variance of each fitted model relative to the true model?
Linear: low bias, low variance; degree- : low bias, high variance; degree- : high bias, high variance.
Linear: high bias, high variance; degree- : low bias, low variance; degree- : high bias, low variance.
Linear: low bias, high variance; degree- : high bias, low variance; degree- : low bias, high variance.
Linear: high bias, low variance; degree- : low bias, low variance; degree- : low bias, high variance.
Consider logistic regression on one-dimensional data, with (the model is ). The current weight is , the training set is a single example , and the step size is . Gradient ascent is performed directly on the log-likelihood of the data. Compute after one gradient-ascent step. (Round to decimal places; enter if it cannot be determined.)
In logistic regression, a point is classified positive only if . What score threshold (with at the boundary of this rule) does this correspond to? (Round to decimal places.)
Consider one-dimensional linear regression with no bias term, . The squared-error objective over the training set is
. The dataset is . Starting from with learning rate perform one gradient-descent step. What is the model's prediction at ?
Consider binary classification on input features . Define the decision boundary of a trained classifier as the set of points at which its predicted label changes. For which of the following method(s) can this decision boundary be non-linear in ?
Perceptron.
Logistic regression, predicting the positive class when .
-nearest-neighbour with Euclidean distance.
A decision tree using axis-aligned splits.
Gaussian Naïve Bayes in which the class-conditional feature variances differ between the two classes.
A support vector machine with a linear kernel.
A support vector machine with an RBF (Gaussian) kernel.
In logistic regression, a point is classified positive only if . What score threshold (with at the boundary of this rule) does this correspond to? (Round to 2 decimal places.)
Let be the solution to the ordinary least-squares linear regression problem
. Which of the following is always satisfied at ? Note that here is your feature matrix and is the label vector.
Consider one-dimensional ridge regression with no bias term. Given
and
, with , compute the optimal . Note that is th data point and is th label. (Round to 2 decimal places.)
Consider a binary classification dataset in which the two classes are perfectly linearly separable. You are considering a Perceptron, Logistic Regression, and a Decision Tree. If the objective is to learn a linear decision boundary and no probability estimates are required, which of the following classifiers are appropriate choices?
Under the probabilistic view of linear regression, assume where the observations are independent. Suppose the true noise variance is instead of , while the dataset and the observed labels remain unchanged. What happens to the maximum likelihood estimator
On a machine that folds plastic film, the operating temperature can be varied between and . To study the relationship between temperature and fold thickness, observations of temperature and the corresponding fold thickness were collected. The scatter plot along with the fitted simple linear regression line is shown below.
Determine, by inspecting the figure, which of the following sets of parameter estimates for the simple linear regression model is most appropriate. Note: The regression model is where Here, is the estimated intercept,• is the estimated slope, and• is the estimated standard deviation of the error term.•
A student minimizes the sum of squared errors (SSE) loss
while another student minimizes the mean squared error (MSE) loss
Both students use gradient descent with the same learning rate and the same initial parameter vector . Which one of the following statements is correct?
They converge to different minimizers, because the losses differ.
They converge to the same minimizer, but 's steps are times smaller; would need learning rate to reproduce 's trajectory.
They converge to the same minimizer, and their iterates coincide at every step.
They converge to the same minimizer, but 's steps are times larger.
Suppose the label vector is orthogonal to every feature vector, i.e. for all . is the optimal weight obtained after minimizing the objective function of linear regression. Which statement is correct?
Consider a regression problem in which we use a neural network with the following architecture: Input layer has neurons• Two hidden layers, each with neurons• Output layer with one neuron• Find the total number of parameters in the network. Ignore the biases.
Consider a logistic regression classifier trained on a dataset for a binary classification problem with features in and labels in . The weight vector learnt by the classifier is . Given a test data-point , the probability
, where is the base of the natural logarithm. Find the value of and enter the nearest integer as your answer.
Consider a dataset with two data-points for a binary classification problem with features in . is a data-point from the positive class while is from the negative class. We now consider three linear classifiers: perceptron, logistic regression and SVM.
If is the weight vector with the largest margin, which of the following is true?
Consider a dataset consisting of datapoints , where each . Let the four features be denoted by and .Suppose the features satisfy the following linear relationship: That is, one of the features is an exact linear combination of others. A linear regression model is trained to predict a target variable using these features. Consider the following statements: Consider the following statements: Which of the following is (are) true?
Linear regression without regularization will achieve training MSE less than or equal to that of ridge regression.
The solution for linear regression without regularization may not be unique.
Ridge regression (L2 regularization) will always set at least one coefficient exactly to zero.
Lasso regression (L1 regularization) can force some feature weights to become exactly zero.
Consider a binary classification problem using logistic regression. The model predicts the probability of class as:
A threshold of is used for classification. The predicted class label is given by:
The values of for the following datapoints are: How many datapoints will be classified as class ?
Consider a regression problem in which we use a neural network with the following architecture: • Input layer has neurons • Three hidden layers, each with neurons • Output layer with one neuron Find the total number of parameters in the network. Ignore the biases.
Consider a linear regression model applied to a dataset in which each data-point is described by two features. The first feature is always . The data-point's feature-label pair is represented as . Let be the optimal weight vector that minimizes the sum of squared errors. Consider two scenarios: : , for each data-point . : , for each data-point . Which of the following is true?
In Ridge Regression, the optimal weight vector is given by . The regularization parameter is determined using 5-fold cross-validation. The following table summarizes the average Training Error and Validation Error (Mean Squared Error) obtained for various values of :
Based on the cross-validation results provided, what is the most appropriate choice for ?
A researcher is modeling a dataset using linear regression of the form . They are considering two different probabilistic assumptions for the independent and identically distributed (i.i.d.) noise term : • Assumption A: The noise follows a Gaussian distribution, . • Assumption B: The noise follows a Laplace distribution, . The training dataset is known to contain several extreme outliers resulting from sensor malfunctions. Which of the following statements correctly describes the behavior of the Maximum Likelihood Estimation (MLE) for the parameter vector ?
Under Assumption A, the MLE is equivalent to minimizing Mean Squared Error (MSE), which is highly sensitive to outliers because the penalty grows quadratically.
Under Assumption B, the MLE is equivalent to L1 regularization, which is more robust to outliers because the penalty for large residuals grows linearly.
Both Assumption A and Assumption B lead to the same optimal parameter vector regardless of the presence of outliers.
Let the linear regression model's solution be written as , where . Let be a valid kernel function. What will be the prediction for an unseen data point ?
Perform a 3-NN regressor for the following dataset:
where, is a feature vector and is the label. What will be the predicted value for the test data point ? ___________ Enter the answer correct to one decimal place.
Consider a logistic regression model trained to detect spam emails. Emails containing harmful phishing links are labeled as spam (1), while regular emails are labeled as not spam (0).
A good spam detector should correctly identify almost all emails with phishing links. Even a single phishing email incorrectly classified as not spam could expose users to significant risks. However, the detector may classify some regular emails as spam. This trade-off is acceptable to ensure safety.
To ensure user safety, if the threshold is set to a low value to prioritize the detection of phishing emails, type 1. If the threshold is set to a high value to minimize false positives (misclassifying regular emails as spam), type 0.
Ridge regression and Lasso regression both puts a limit on the length ofweight vector.
Ridge regression puts limit on length of the weight vector but LASSOregression does not put a limit on weight vector length.
When many features are redundant, then LASSO regression is moreappropriate than ridge regression and linear regression as LASSO regression produces sparseweights for those features.
When many features are redundant, then linear regression is moreappropriate than ridge regression and LASSO regression
Suppose you run gradient descent for linear regression for 500 iterations with a learning rate 0.02. You observe that the training loss (sum of squared loss) is increasing after every iteration. What may be the reason? What changes would you make to the set-up for the gradient descent to converge to a solution?
Number of features in the training data may be too low, try increasing them.
Number of features in the training data may be too high, try reducing them.
Suppose you run gradient descent for linear regression for 100 iterations with a learning rate 0.01. You observe that the training loss (sum of squared loss) is increasing after every iteration. What may be the reason? What changes would you make to the set-up for the gradient descent to converge to a solution?
Learning rate may be too low; Try increasing it.
Learning rate may be too high; Try reducing it.
Number of features in the training data may be too low, try increasing them.
Number of features in the training data may be too high, try reducing them.
Based on the above data, answer the given subquestions.
If the present price of a car which is driven for 5 years is 9.5 lac. If the car has an LPG engine, what will be the prediction for the selling price of the car according to the given regression tree? Enter your answer in lac. If your answer is 5.6 lac, enter the answer 5.6.
Based on the above data, answer the given subquestions.
If the present price of a car which is driven for 7 years is 6.0 lac. If the car has a diesel engine, what will be the prediction for the selling price of the car according to the given regression tree? Enter your answer in lac. If your answer is 5.6 lac, enter the answer 5.6.
Which of the following could be the vector of probabilities output by a softmax regression model for 5 classes? Note that the options are independent of each other.
Consider a logistic regression model that is trained on videos to detect objectionable content. Videos with objectionable content belong to the positive class (label 1). Harmless videos belong to the negative class (label 0). A good detector should be able to correctly identify almost all videos that are objectionable. If it incorrectly classifies even a single video that has inappropriate content in it, that could have serious consequences, as millions of people might end up watching it. In this process the detector may classify some harmless videos as belonging to the positive class. But that is a price we are willing to pay. How should we choose the threshold (for inference) of this logistic regression model?
The threshold should be a low value.
The threshold should be a high value.
The performance of the classifier is independent of the threshold.