chapter

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

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

    Try a question

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

    Question 1
    Level 4: Challenger

    Consider the Lasso regression problem , where and . What is the minimum value of the regularization parameter for which the optimal coefficient is exactly zero?

    Question 2
    Level 4: Challenger

    Consider a Gaussian Naive Bayes classifier for two classes, and , with equal priors . The features are conditionally independent given the class.

    For : and .

    For : and .

    Given the observation , which of the following statements are correct?

    Question 3
    Level 4: Challenger

    Consider the objective function , where . Gradient descent is used to minimize with a fixed learning rate . The update rule is . What is the supremum of such that the algorithm is guaranteed to converge to the global minimum for any initialization?

    Question 4
    Level 4: Challenger

    Let and . In a Ridge regression model, the coefficient vector is obtained by minimizing the objective function . For what value of the regularization parameter is the squared Euclidean norm of the coefficient vector exactly equal to 2?

    Question 5
    Level 4: Challenger

    Consider a Ridge regression model trained on a dataset with samples and features, using a regularization parameter . Let be the corresponding hat matrix, and let be the predicted value for the -th training point. The leave-one-out cross-validation (LOOCV) error for the -th point is defined as the squared error when the model is retrained without the -th sample. Which of the following expressions correctly give the value of this LOOCV error for the -th point, where is the -th diagonal element of ?

    Question 6
    Level 4: Challenger

    A linear regression model is trained on a dataset with features. The design matrix is such that the eigenvalues of are and $0$. A Ridge regression model is fitted with regularization parameter . The effective degrees of freedom of the fitted model is defined as . What is the effective degrees of freedom of this Ridge regression model? (Round off to 2 decimal places)

    Question 7
    Level 4: Challenger

    Consider a binary classification problem with the positive class and the negative class . The classes are not linearly separable in the original space. We map the data to a higher-dimensional space using the feature map . In this new space, the classes are linearly separable. What is the maximum margin of the optimal separating hyperplane in the feature space? (Round off to 2 decimal places)

    Question 8
    Level 4: Challenger

    Two classes in a 1-dimensional feature space have equal prior probabilities. Class follows a normal distribution and Class follows . The Bayes optimal classifier decides the class based on the maximum posterior probability. The decision boundary consists of two points, and (with ). Which of the following are the exact values of these decision boundary points?

    Question 9
    Level 4: Challenger

    Consider the Perceptron learning algorithm with initial weights and bias . The training data is presented in the cyclic order ; ; . The update rule is: if , then and . How many weight updates are made before the algorithm converges?

    Question 10
    Level 4: Challenger

    Consider a dataset containing all $8$ possible combinations of three boolean features $A, B, C \in \{0, 1\}$. The target variable $Y \in \{0, 1\}$ is defined as the majority function: $Y = 1$ if and only if at least two of the features are $1$. We want to build a decision tree that perfectly classifies this dataset. What is the minimum number of leaf nodes required in such a decision tree?

    Free preview ends here

    Login to view the complete short 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 3 — Unit 2 — Machine Learning Short Notes for GATE DA

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

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

    Question 1 · Machine Learning MCQ

    Consider the Lasso regression problem , where and . What is the minimum value of the regularization parameter for which the optimal coefficient is exactly zero?

    1. A.

      4

    2. B.

      8

    3. C.

      16

    4. D.

      24

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: The Lasso objective is . The optimal if and only if $0$ is in the subdifferential of at . This gives a condition on based on the gradient of the smooth part.

    Step 1: The smooth part is . Its gradient is .

    Step 2: At , .

    Step 3: The subdifferential of the non-smooth part at is .

    Step 4: The optimality condition for is .

    Step 5: This requires . The minimum value of is 8.

    Answer: 8.

    Question 2 · Machine Learning MSQ

    Consider a Gaussian Naive Bayes classifier for two classes, and , with equal priors . The features are conditionally independent given the class.

    For : and .

    For : and .

    Given the observation , which of the following statements are correct?

    1. A.

      The log-odds \ln \frac{P(C_1 | x)}{P(C_0 | x)} is -4

    2. B.

      The log-odds \ln \frac{P(C_1 | x)}{P(C_0 | x)} is 4

    3. C.

      The probability P(C_1 | x) is \frac{e^{-4}}{1 + e^{-4}}

    4. D.

      The probability P(C_1 | x) is \frac{1}{1 + e^{-4}}

    Correct Answer:

    ["A","C"]

    Step-by-Step Solution

    Insight: The log-odds is the sum of the log-prior ratio and the log-likelihood ratios of each feature. For Gaussian NB, each feature's contribution is a simple quadratic difference. The probability is then just the sigmoid of the log-odds.

    Exam route: Compute for . Sum them up to get the log-odds . Then .

    Learning route:

    Step 1 (why this method): The statement asks for the log-odds and the posterior probability. By definition, the log-odds is . Using Bayes' theorem and the conditional independence of features:

    Since priors are equal, the first term is 0. We just need to sum the log-likelihood ratios for each feature.

    Step 2 (compute feature 1 contribution):

    Difference for : .

    Step 3 (compute feature 2 contribution):

    Difference for : .

    Step 4 (combine and convert to probability):

    Total log-odds .

    The posterior probability is:

    Answer: Options A and C.

    The tempting wrong path: A student might drop the negative sign in the Gaussian exponent, computing but then adding it instead of subtracting, leading to a log-odds of (Option B). Another common mistake is confusing with , or using in the numerator, which leads to (Option D). The break in both cases is in Step 4: the sigmoid function is strictly , and the sign of determines which class is more probable.

    Generalisation: For Gaussian NB, the log-likelihood ratio for a feature is . If the variances are equal, this simplifies to a linear function of .

    Verification: Since , we must have . Option C gives , which is indeed . Option D gives , which would imply , a contradiction.

    Question 3 · Machine Learning MCQ

    Consider the objective function , where . Gradient descent is used to minimize with a fixed learning rate . The update rule is . What is the supremum of such that the algorithm is guaranteed to converge to the global minimum for any initialization?

    1. A.

      1/6

    2. B.

      1/3

    3. C.

      2/7

    4. D.

      1/2

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: Gradient descent on a quadratic function converges if and only if the learning rate satisfies , where is the largest eigenvalue of the Hessian matrix .

    Step 1: Identify the Hessian matrix .

    Step 2: Find the eigenvalues of by solving .

    .

    Step 3: The eigenvalues are and . Thus, .

    Step 4: The supremum of for guaranteed convergence is .

    Answer: 1/3 (Option B).

    Question 4 · Machine Learning MCQ

    Let and . In a Ridge regression model, the coefficient vector is obtained by minimizing the objective function . For what value of the regularization parameter is the squared Euclidean norm of the coefficient vector exactly equal to 2?

    1. A.

      2

    2. B.

      3

    3. C.

      4

    4. D.

      5

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: The closed-form solution for Ridge regression is . We can compute this explicitly and then solve for using the given norm condition.

    Step 1: Compute .

    Step 2: Compute .

    Step 3: Find the inverse of .

    The determinant is .

    The inverse is .

    Step 4: Compute .

    Step 5: Compute .

    Step 6: Set .

    Answer: 2.

    Question 5 · Machine Learning MSQ

    Consider a Ridge regression model trained on a dataset with samples and features, using a regularization parameter . Let be the corresponding hat matrix, and let be the predicted value for the -th training point. The leave-one-out cross-validation (LOOCV) error for the -th point is defined as the squared error when the model is retrained without the -th sample. Which of the following expressions correctly give the value of this LOOCV error for the -th point, where is the -th diagonal element of ?

    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    ["A","D"]

    Step-by-Step Solution

    Key idea: For any linear smoother , the leave-one-out cross-validation (LOOCV) error can be computed directly from the training residuals and the diagonal of the hat matrix without retraining the model.

    Step 1: The relationship between the full-model prediction and the leave-one-out prediction is given by .

    Step 2: The leave-one-out residual is .

    Step 3: The LOOCV error is the square of this residual: . This matches option A.

    Step 4: Option D is . Since , option D is algebraically identical to option A.

    Step 5: Option B is incorrect because it misses the square on the denominator . Option C is incorrect due to a sign error in the denominator ( instead of ).

    Answer: A, D.

    Question 6 · Machine Learning NAT

    A linear regression model is trained on a dataset with features. The design matrix is such that the eigenvalues of are and $0$. A Ridge regression model is fitted with regularization parameter . The effective degrees of freedom of the fitted model is defined as . What is the effective degrees of freedom of this Ridge regression model? (Round off to 2 decimal places)

    Correct Answer:

    1.17

    Step-by-Step Solution

    Insight: The effective degrees of freedom for Ridge regression is the trace of the smoother matrix , which simplifies elegantly to the sum of over all eigenvalues of .

    Exam route: Identify the eigenvalues of as . Plug them directly into the formula with . Calculate .

    Learning route:

    Step 1 (why this method): The statement defines the effective degrees of freedom as where . This is the standard definition for the effective degrees of freedom in Ridge regression, measuring the complexity of the fitted model.

    Step 2 (derive the formula): Let the eigendecomposition of be , where is the diagonal matrix of eigenvalues . Then .

    Substituting this into :

    .

    Using the cyclic property of the trace, .

    Since , this simplifies to .

    Step 3 (compute the value): Substitute the given eigenvalues and :

    .

    Step 4 (format the answer): Convert the fraction to a decimal:

    Rounding to 2 decimal places gives $1.17$.

    Answer: 1.17.

    The tempting wrong path: A student might recall that the degrees of freedom in OLS is the rank of (the number of non-zero eigenvalues), which is 2 here, and answer 2.00. This ignores the effect of the regularization parameter . Another wrong path is using the formula , which incorrectly omits the eigenvalues from the denominator, yielding . A third mistake is inverting the fraction to , which gives . The break in all these cases is in Step 2: the exact trace formula requires in the numerator and in the denominator.

    Generalisation: The effective degrees of freedom in Ridge regression is a continuous value between 0 and the rank of . As , it approaches the OLS degrees of freedom (the rank). As , it approaches 0.

    Verification: For , the shrinkage factors are , , and . The sum is $1.17$, which is strictly less than the rank of (which is 2), consistent with the shrinkage effect of Ridge regression.

    Question 7 · Machine Learning NAT

    Consider a binary classification problem with the positive class and the negative class . The classes are not linearly separable in the original space. We map the data to a higher-dimensional space using the feature map . In this new space, the classes are linearly separable. What is the maximum margin of the optimal separating hyperplane in the feature space? (Round off to 2 decimal places)

    Correct Answer:

    1.00

    Step-by-Step Solution

    Key idea: The maximum margin in a Support Vector Machine is exactly half the minimum distance between the convex hulls of the two classes in the feature space.

    Step 1: Map the given points using .

    For : and .

    For : and .

    Step 2: Identify the convex hulls in the 3D feature space.

    The convex hull of is the line segment connecting and . Any point on is of the form for .

    The convex hull of is the line segment connecting and . Any point on is of the form for .

    Step 3: Find the minimum distance between and .

    The squared distance between a point on and on is .

    This distance is minimized when and , giving a minimum distance of .

    Step 4: The maximum margin is half of this minimum distance.

    Maximum margin = .

    Answer: 1.00

    Question 8 · Machine Learning MSQ

    Two classes in a 1-dimensional feature space have equal prior probabilities. Class follows a normal distribution and Class follows . The Bayes optimal classifier decides the class based on the maximum posterior probability. The decision boundary consists of two points, and (with ). Which of the following are the exact values of these decision boundary points?

    1. A.

      \sqrt{\frac{8}{3} \ln 2}

    2. B.

      -\sqrt{\frac{8}{3} \ln 2}

    3. C.

      \sqrt{4 \ln 2}

    4. D.

      \sqrt{\frac{8}{3} \log_{10} 2}

    Correct Answer:

    ["A","B"]

    Step-by-Step Solution

    Insight: For equal priors, the Bayes decision boundary is exactly where the class-conditional densities are equal: . For Gaussians, this reduces to equating the PDFs and solving for .

    Exam route: Write the equality of the two Gaussian PDFs, take the natural logarithm of both sides to bring down the exponents, and solve the resulting linear equation in . The roots are .

    Learning route:

    Step 1 (why this method): The statement specifies "equal prior probabilities" and "maximum posterior probability". By Bayes' theorem, . Since , the decision boundary simplifies exactly to . This is the defining equation for the boundary.

    Step 2 (set up the equation): The PDFs are

    Equating them:

    Step 3 (solve for ): Take the natural logarithm of both sides:

    Rearrange to isolate :

    Answer: Options A and B.

    The tempting wrong path: A student might use the standard deviation instead of the variance in the exponent of the Gaussian PDF. For , they would write instead of . This leads to , landing exactly on option C. Another trap is using instead of when simplifying the normalization constants, which yields option D. The break in both cases is in Step 2: the Gaussian exponent is strictly , and the normalization constant requires the natural logarithm to cancel cleanly.

    Generalisation: For two Gaussians with the same mean but different variances, the decision boundary is always symmetric around the mean, and the distance from the mean depends on the ratio of the variances and the log of their ratio.

    Verification: Plug back into the PDFs. The exponent for is , and for is . The ratio of the exponents is , which exactly matches the ratio of the variances , confirming the densities are equal.

    Question 9 · Machine Learning MCQ

    Consider the Perceptron learning algorithm with initial weights and bias . The training data is presented in the cyclic order ; ; . The update rule is: if , then and . How many weight updates are made before the algorithm converges?

    1. A.

      4

    2. B.

      5

    3. C.

      6

    4. D.

      8

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: The Perceptron algorithm updates weights when the margin . We must trace the updates cycle by cycle until all points are correctly classified with a positive margin.

    Step 1: Initialize .

    Step 2: Cycle 1:

    • : . (Update 1)
    • : . (Update 2)
    • : . (Update 3)

    Step 3: Cycle 2:

    • : . (Update 4)
    • : . (Update 5)
    • : no update.

    Step 4: Cycle 3:

    • : . (Update 6)
    • : no update.
    • : no update.

    Step 5: Cycle 4: All points yield positive margins. The algorithm converges.

    Total updates = 6.

    Answer: 6 (Option C).

    Question 10 · Machine Learning NAT

    Consider a dataset containing all $8$ possible combinations of three boolean features $A, B, C \in \{0, 1\}$. The target variable $Y \in \{0, 1\}$ is defined as the majority function: $Y = 1$ if and only if at least two of the features are $1$. We want to build a decision tree that perfectly classifies this dataset. What is the minimum number of leaf nodes required in such a decision tree?

    Correct Answer:

    6.00

    Step-by-Step Solution

    Key idea: A decision tree leaf node represents a subcube of the feature space (defined by fixing a subset of features). To minimize the number of leaves, we must partition the instances into the largest possible pure subcubes.

    Step 1: List the instances and their labels.

    Zeros (): 000, 001, 010, 100.

    Ones (): 011, 101, 110, 111.

    Step 2: Identify the largest pure subcubes.

    A subcube of size 4 (fixing 1 feature) will always contain both 0s and 1s for the majority function. So the maximum size of a pure subcube is 2 (an edge, fixing 2 features).

    Step 3: Find the disjoint pure edges.

    For the zeros, the possible pure edges are 000-001, 000-010, and 000-100. Notice that all three edges share the vertex 000. Therefore, we can select at most ONE disjoint pure edge for the zeros.

    Similarly, for the ones, the possible pure edges are 111-110, 111-101, and 111-011. They all share the vertex 111. We can select at most ONE disjoint pure edge for the ones.

    Step 4: Count the remaining instances.

    After selecting one pure edge for zeros (covers 2 instances) and one for ones (covers 2 instances), we have 4 instances remaining. None of these remaining instances can form a pure edge with each other, so they must each be a leaf node of size 1.

    Step 5: Calculate the total number of leaves.

    Total leaves = 1 (zero edge) + 1 (one edge) + 4 (singletons) = 6.

    Answer: 6.00

    More short notes in this unit