chapter

    Chapter 2 — Unit 2 — Machine Learning Notes for Gate Da

    Chapter 2 — Unit 2 — Machine Learning notes for GATE DA: 0 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    Level 4: Challenger

    Consider a regression dataset with a single feature (no intercept term) and three observations:

    The ridge regression coefficient with regularization parameter is computed using the closed-form solution

    What is the value of ?

    Question 2
    Level 4: Challenger

    An ensemble classifier is built by bagging base models. Each base model has a variance of and a bias of $0.2$. The pairwise correlation between the predictions of any two distinct base models is . The irreducible noise in the data is $0.1$.

    Using the standard bias-variance decomposition for ensemble methods, what is the expected test mean squared error (MSE) of this ensemble?

    Question 3
    Level 4: Challenger

    Consider a dataset with covariance matrix . Let be the largest eigenvalue, be the fraction of total variance explained by the first principal component, be the projection of the vector onto the first principal component direction, and be the fraction of total variance explained by the second principal component. Which of the following correctly match the quantity with its value?

    Question 4
    Level 4: Challenger

    Consider the perceptron learning algorithm with the update rule and for a misclassified point (where ). Given the initial parameters and , and the following sequence of three training points processed in one pass:

    .

    What is the sum of all components of and (i.e., ) at the end of this single pass?

    Question 5
    Level 4: Challenger

    Consider a binary classification dataset with 10 instances. The target variable has 5 instances of class 1 and 5 instances of class 0. There are two binary features .

    In class 1, appears 4 times and appears 3 times.

    In class 0, appears 2 times and appears 4 times.

    A Naive Bayes classifier is trained on this dataset using Laplace (add-1) smoothing.

    For a test instance with and , what is the predicted posterior probability ? (Round off to 2 decimal places)

    Question 6
    Level 4: Challenger

    Consider a binary classification dataset with four instances and two features (no bias term):

    We fit a logistic regression model where the probability of the positive class is , and is the sigmoid function. The negative log-likelihood loss function is:

    What is the determinant of the Hessian matrix of evaluated at the initial weight vector ?

    Question 7
    Level 4: Challenger

    Consider a 1D linear regression problem with a single weight (no bias term) and L1 regularization (Lasso). The objective function to minimize is:

    Given the dataset and , and the regularization parameter , what is the optimal value of that minimizes ?

    Question 8
    Level 4: Challenger

    Consider a single artificial neuron with weight vector , bias , and ReLU activation . The neuron computes

    For the four input points , , , , what is the value of

    Question 9
    Level 4: Challenger

    Consider the regularized hinge loss objective for a linear classifier with weight vector and bias :

    Given the current parameters and the four data points:

    , \ ,

    , \ .

    What is the sum of the components of the gradient of with respect to at this point?

    Question 10
    Level 4: Challenger

    Consider a dataset with four 2D points: , , , . The initial cluster centroids are and . Using the standard K-Means algorithm with squared Euclidean distance, which of the following are correct values for the parameters after the very first update step?

    Free preview ends here

    Login to view the complete notes

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Chapter 2 — Unit 2 — Machine Learning Notes for GATE DA

    Chapter 2 — Unit 2 — Machine Learning notes for GATE DA: 0 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.

    Chapter 2 — Unit 2 — Machine Learning: Solved Questions with Step-by-Step Explanations (10 Problems)

    Question 1 · Machine Learning MCQ

    Consider a regression dataset with a single feature (no intercept term) and three observations:

    The ridge regression coefficient with regularization parameter is computed using the closed-form solution

    What is the value of ?

    1. A.

      0.50

    2. B.

      1.00

    3. C.

      2.00

    4. D.

      3.00

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a direct-application ridge regression question. With a single feature and no intercept, is a column vector, so is a scalar and the formula reduces to .

    Step 1: Form and .

    Step 2: Compute .

    Step 3: Compute .

    Step 4: Apply the ridge formula: .

    Answer: 1.00 (Option B).

    Question 2 · Machine Learning MCQ

    An ensemble classifier is built by bagging base models. Each base model has a variance of and a bias of $0.2$. The pairwise correlation between the predictions of any two distinct base models is . The irreducible noise in the data is $0.1$.

    Using the standard bias-variance decomposition for ensemble methods, what is the expected test mean squared error (MSE) of this ensemble?

    1. A.

      0.28

    2. B.

      0.19

    3. C.

      0.64

    4. D.

      0.44

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is a bias-variance decomposition question for an ensemble model. The MSE of the ensemble is the sum of the squared bias, the ensemble variance, and the irreducible noise. The ensemble variance depends on the individual variance, the number of models, and their pairwise correlation.

    Step 1: Identify the given parameters: , , , , .

    Step 2: Compute the ensemble variance using the formula .

    .

    Step 3: Compute the squared bias: .

    Step 4: Compute the total expected test MSE: .

    Answer: 0.28 (Option A).

    Question 3 · Machine Learning MSQ

    Consider a dataset with covariance matrix . Let be the largest eigenvalue, be the fraction of total variance explained by the first principal component, be the projection of the vector onto the first principal component direction, and be the fraction of total variance explained by the second principal component. Which of the following correctly match the quantity with its value?

    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    ["A","B","C"]

    Step-by-Step Solution

    Key idea: This is a direct-formula PCA question. The principal components and their variances are determined by the eigenvalues and normalized eigenvectors of the covariance matrix .

    Step 1: Find the eigenvalues of . The characteristic equation is .

    Here, and .

    The equation is , giving and . Option A is correct.

    Step 2: Compute the variance fractions. The total variance is the trace, which is 7.

    The fraction for the first PC is . Option B is correct.

    The fraction for the second PC is . Option D claims , which is incorrect (it mistakenly uses the off-diagonal element).

    Step 3: Find the first principal component direction (eigenvector for ).

    Solve .

    The normalized eigenvector is .

    Step 4: Compute the projection of onto .

    . Option C is correct.

    Answer: A, B, C.

    Question 4 · Machine Learning MSQ

    Consider the perceptron learning algorithm with the update rule and for a misclassified point (where ). Given the initial parameters and , and the following sequence of three training points processed in one pass:

    .

    What is the sum of all components of and (i.e., ) at the end of this single pass?

    1. A.

      3

    2. B.

      -6

    3. C.

      2

    4. D.

      5

    Correct Answer:

    ["A"]

    Step-by-Step Solution

    Key idea: This is a casework question on the perceptron update rule. For each point, you must evaluate the margin . If it is , the point is misclassified and you apply the update. The casework is tracking the changing values of and after each update.

    Step 1: Process .

    . Margin . Misclassified.

    .

    .

    Step 2: Process .

    . Margin . Misclassified.

    .

    .

    Step 3: Process .

    . Margin . Misclassified.

    .

    .

    Step 4: Final parameters are and .

    Sum of components . Option A is correct.

    Answer: A.

    Question 5 · Machine Learning NAT

    Consider a binary classification dataset with 10 instances. The target variable has 5 instances of class 1 and 5 instances of class 0. There are two binary features .

    In class 1, appears 4 times and appears 3 times.

    In class 0, appears 2 times and appears 4 times.

    A Naive Bayes classifier is trained on this dataset using Laplace (add-1) smoothing.

    For a test instance with and , what is the predicted posterior probability ? (Round off to 2 decimal places)

    Correct Answer:

    0.80

    Step-by-Step Solution

    Key idea: This is a direct-formula Naive Bayes question with Laplace smoothing. The posterior probability is proportional to the prior times the likelihoods. Laplace smoothing adds 1 to the numerator and the number of feature values (which is 2 for binary features) to the denominator.

    Step 1: Compute the priors.

    Step 2: Compute the likelihoods with Laplace smoothing.

    For :

    For :

    Step 3: Compute the unnormalized posteriors.

    Step 4: Normalize to find the true posterior for .

    .

    Answer: 0.80

    Question 6 · Machine Learning NAT

    Consider a binary classification dataset with four instances and two features (no bias term):

    We fit a logistic regression model where the probability of the positive class is , and is the sigmoid function. The negative log-likelihood loss function is:

    What is the determinant of the Hessian matrix of evaluated at the initial weight vector ?

    Correct Answer:

    2.25

    Step-by-Step Solution

    Key idea: This is a direct-formula question on the Hessian of the logistic regression loss. The Hessian matrix is given by , where . At , the pre-activation is 0 for all points, so and the scalar factor is constant across all instances.

    Step 1: Evaluate the scalar factor at .

    Since for all , .

    The factor is .

    Step 2: Compute the unnormalized sum of outer products .

    .

    Step 3: Compute the Hessian .

    .

    Step 4: Calculate the determinant of .

    .

    Answer: 2.25

    Question 7 · Machine Learning NAT

    Consider a 1D linear regression problem with a single weight (no bias term) and L1 regularization (Lasso). The objective function to minimize is:

    Given the dataset and , and the regularization parameter , what is the optimal value of that minimizes ?

    Correct Answer:

    2.20

    Step-by-Step Solution

    Key idea: This is a casework question on L1-regularized linear regression. The absolute value makes the objective function piecewise. We must optimize separately for and , and then check the non-differentiable point using subgradients.

    Step 1: Expand the unregularized loss .

    .

    Step 2: Casework for . Here .

    .

    To find the minimum, set the derivative to 0:

    .

    Since , this is a valid critical point in this region.

    Step 3: Casework for . Here .

    .

    Set the derivative to 0:

    .

    Since $3$ is not in the region , there is no minimum in this region.

    Step 4: Check the non-differentiable point .

    The subdifferential of at is .

    .

    Subdifferential at is .

    Since $0$ is not in the interval , is not the minimum.

    Step 5: Compare valid critical points.

    The only valid critical point is .

    Answer: 2.20

    Question 8 · Machine Learning MCQ

    Consider a single artificial neuron with weight vector , bias , and ReLU activation . The neuron computes

    For the four input points , , , , what is the value of

    1. A.

      1

    2. B.

      2

    3. C.

      3

    4. D.

      14

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a casework question on ReLU. For each input, compute the pre-activation , then apply . The casework is whether or .

    Step 1: .

    Step 2: .

    Step 3: .

    Step 4: .

    Step 5: Sum .

    Answer: 3 (Option C).

    Question 9 · Machine Learning MCQ

    Consider the regularized hinge loss objective for a linear classifier with weight vector and bias :

    Given the current parameters and the four data points:

    , \ ,

    , \ .

    What is the sum of the components of the gradient of with respect to at this point?

    1. A.

      5

    2. B.

      -3

    3. C.

      4

    4. D.

      8

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is a casework question on the subgradient of the regularized hinge loss. For each data point, you must check the condition to determine if the loss is active. If active, the subgradient with respect to is . The total gradient includes the regularization term .

    Step 1: Compute and for each point.

    . Loss is 0, subgradient is .

    . Loss is active, subgradient is .

    . Loss is active, subgradient is .

    . Loss is active, subgradient is .

    Step 2: Sum the subgradients: .

    Step 3: Add the regularization gradient .

    Total gradient = .

    Step 4: Sum the components of the gradient: .

    Answer: 5 (Option A).

    Question 10 · Machine Learning MSQ

    Consider a dataset with four 2D points: , , , . The initial cluster centroids are and . Using the standard K-Means algorithm with squared Euclidean distance, which of the following are correct values for the parameters after the very first update step?

    1. A.

      The updated centroid is

    2. B.

      The updated centroid is

    3. C.

      The total within-cluster sum of squares (WCSS) is $2.0$

    4. D.

      The total within-cluster sum of squares (WCSS) is $1.0$

    Correct Answer:

    ["A","C"]

    Step-by-Step Solution

    Key idea: This is a direct-formula K-Means question. The first step is to assign each point to the nearest centroid using squared Euclidean distance. The second step is to recompute the centroids as the mean of the assigned points, and finally compute the WCSS.

    Step 1: Compute squared distances to and .

    : , Cluster 1.

    : , Cluster 1.

    : , Cluster 2.

    : , Cluster 2.

    Step 2: Update centroids.

    . Option A is correct.

    . Option B claims , which is the old centroid (incorrect).

    Step 3: Compute WCSS.

    For Cluster 1: .

    For Cluster 2: .

    Total WCSS = . Option C is correct, Option D is incorrect.

    Answer: A, C.

    More notes in this unit