chapter

    Chapter 1 — Supervised Learning Notes for Gate Da

    Chapter 1 — Supervised 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 hard-margin Support Vector Machine trained on the following dataset in :

    Positive class ():

    Negative class (): ,

    The SVM optimization problem is formulated in the primal as:

    Which of the following are the exact values for the parameters and metrics of the optimal classifier?

    Question 2
    Level 4: Challenger

    In 5-fold cross-validation on a regression task, the training and validation errors (MSE) for each fold are:

    Fold 1: train = 0.12, val = 0.25

    Fold 2: train = 0.15, val = 0.28

    Fold 3: train = 0.11, val = 0.22

    Fold 4: train = 0.14, val = 0.26

    Fold 5: train = 0.13, val = 0.24

    The cross-validation estimate of generalization error is the mean of validation errors. A student incorrectly computes it as the mean of across all folds.

    What is the absolute difference between the correct estimate and the student's estimate?

    Question 3
    Level 4: Challenger

    Consider a dataset with a single feature and target , given by the points and . We fit a linear regression model using Ridge regression with regularization parameter . In the standard formulation, the bias term is NOT regularized.

    Let the design matrix be and target vector . The weight vector is .

    What is the exact value of the slope obtained by minimizing the Ridge regression objective?

    Question 4
    Level 4: Challenger

    Consider the Lasso regression objective for a dataset with two features:

    The dataset is given by , , and . Let .

    We initialize the weights at and perform one full cycle of coordinate descent (first updating , then updating using the updated ).

    The update rule for is , where is the residual , and is the soft-thresholding operator.

    What is the value of after this single cycle?

    Question 5
    Level 4: Challenger

    Consider the Perceptron Learning Algorithm with the update rule and applied when . The dataset is given by:

    The algorithm is initialized with and , and cycles through the data points in the order repeatedly until convergence.

    Which of the following statements about the execution of the algorithm are true?

    Question 6
    Level 4: Challenger

    Consider a 3-class Softmax regression model with weight matrix and no bias term. For a given input vector , the pre-activation scores are computed as . The true class label for this input is (using 1-based indexing for the classes).

    Let denote the cross-entropy loss for this single data point. What is the exact value of the partial derivative , where is the weight corresponding to class 2 and the second feature?

    Question 7
    Level 4: Challenger

    Consider a Lasso regression model with the objective function

    where and is an unregularized bias term. Given the training dataset:

    , , .

    Find the maximum value of the regularization parameter for which the optimal solution has at least one strictly non-zero weight (i.e., ). Round your answer to two decimal places.

    Question 8
    Level 4: Challenger

    A logistic regression model for binary classification uses features and . The correct decision function is:

    where , , . A point is classified as class 1 if , else class 0.

    Due to a sign error, the implemented model uses:

    For the following 4 test points, how many are classified differently by the correct vs. incorrect model?

    Points: , , ,

    Question 9
    Level 4: Challenger

    Consider a regression dataset with a single feature and target , given by the points , , , and . We wish to build a decision tree of depth 1 (a single split) to minimize the sum of squared errors (SSE) in the child nodes. The possible split points are midway between consecutive values.

    Which of the following statements about the optimal split and its error are true?

    Question 10
    Level 4: Challenger

    Consider a binary decision tree that perfectly classifies the following dataset in using only axis-parallel splits of the form :

    .

    A student hypothesizes that a tree with 3 leaf nodes is sufficient to perfectly classify this data. This hypothesis leads to a contradiction because any valid root split leaves mixed classes on both sides, forcing both children to be internal nodes. Find the minimum number of leaf nodes required to perfectly classify this dataset.

    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 1 — Supervised Learning Notes for GATE DA

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

    Chapter 1 — Supervised Learning: Solved Questions with Step-by-Step Explanations (10 Problems)

    Question 1 · Machine Learning MSQ

    Consider a hard-margin Support Vector Machine trained on the following dataset in :

    Positive class ():

    Negative class (): ,

    The SVM optimization problem is formulated in the primal as:

    Which of the following are the exact values for the parameters and metrics of the optimal classifier?

    1. A.

      The Lagrange multiplier lpha_1 corresponding to is .

    2. B.

      The bias term is .

    3. C.

      The geometric margin of the classifier is .

    4. D.

      The Lagrange multiplier lpha_2 corresponding to is .

    Correct Answer:

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

    Step-by-Step Solution

    Key idea: This is a hard-margin SVM problem with a symmetric dataset. The key is to find the unnormalized hyperplane by geometry, scale it so the minimum functional margin is exactly 1, and then use the KKT conditions to find the Lagrange multipliers.

    Step 1: Find the unnormalized separating hyperplane.

    By symmetry, the optimal hyperplane is the vertical line midway between and the segment connecting .

    The x-coordinate of is 2. The x-coordinate of is -1.

    The midpoint is .

    So the unnormalized normal is and unnormalized bias is .

    Step 2: Scale to satisfy the standard SVM constraints.

    Calculate the functional margin for the support vectors using :

    For : .

    For : .

    Since the minimum functional margin is 1.5, we scale and by to make it exactly 1.

    .

    .

    This confirms Option B is correct.

    Step 3: Calculate the geometric margin.

    The geometric margin is .

    This confirms Option C is correct.

    Step 4: Find the Lagrange multipliers using KKT conditions.

    We know and .

    Substitute the values:

    .

    This gives two equations:

    .

    The sum constraint gives:

    .

    Substitute and into the first equation:

    .

    Then and .

    This confirms Option A is correct and Option D is incorrect.

    Answer: A, B, C

    Question 2 · Machine Learning MCQ

    In 5-fold cross-validation on a regression task, the training and validation errors (MSE) for each fold are:

    Fold 1: train = 0.12, val = 0.25

    Fold 2: train = 0.15, val = 0.28

    Fold 3: train = 0.11, val = 0.22

    Fold 4: train = 0.14, val = 0.26

    Fold 5: train = 0.13, val = 0.24

    The cross-validation estimate of generalization error is the mean of validation errors. A student incorrectly computes it as the mean of across all folds.

    What is the absolute difference between the correct estimate and the student's estimate?

    1. A.

      0.04

    2. B.

      0.06

    3. C.

      0.08

    4. D.

      0.10

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: Cross-validation estimates generalization error using only validation fold errors, not a blend with training errors.

    Step 1: Compute the correct cross-validation estimate.

    Correct estimate =

    Step 2: Compute the student's incorrect estimate.

    For each fold, compute :

    Fold 1:

    Fold 2:

    Fold 3:

    Fold 4:

    Fold 5:

    Student's estimate =

    Step 3: Find the absolute difference.

    Answer: 0.06

    Question 3 · Machine Learning MCQ

    Consider a dataset with a single feature and target , given by the points and . We fit a linear regression model using Ridge regression with regularization parameter . In the standard formulation, the bias term is NOT regularized.

    Let the design matrix be and target vector . The weight vector is .

    What is the exact value of the slope obtained by minimizing the Ridge regression objective?

    1. A.

      28/19

    2. B.

      2/5

    3. C.

      2

    4. D.

      28/11

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a closed-form Ridge regression question where the bias term must be excluded from the regularization penalty. The key is constructing the correct regularization matrix .

    Step 1: Compute and .

    Step 2: Construct the regularization matrix . Since the bias is not regularized, the first diagonal element is 0.

    Step 3: Compute the Ridge solution .

    The determinant is .

    The inverse is .

    Step 4: Multiply by .

    The slope is .

    Answer: 2/5

    Question 4 · Machine Learning MCQ

    Consider the Lasso regression objective for a dataset with two features:

    The dataset is given by , , and . Let .

    We initialize the weights at and perform one full cycle of coordinate descent (first updating , then updating using the updated ).

    The update rule for is , where is the residual , and is the soft-thresholding operator.

    What is the value of after this single cycle?

    1. A.

      -1.4

    2. B.

      -4.6

    3. C.

      0

    4. D.

      -0.6

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: This is a coordinate descent step for Lasso regression. The core challenge is correctly applying the piecewise soft-thresholding operator and managing the signs of the residuals.

    Step 1: Update .

    The residual is .

    Compute .

    Apply soft-thresholding: .

    Compute .

    .

    Step 2: Update .

    The new residual is .

    Compute .

    Apply soft-thresholding: .

    Compute .

    .

    Step 3: Sum the weights.

    .

    Answer: -1.4

    Question 5 · Machine Learning MSQ

    Consider the Perceptron Learning Algorithm with the update rule and applied when . The dataset is given by:

    The algorithm is initialized with and , and cycles through the data points in the order repeatedly until convergence.

    Which of the following statements about the execution of the algorithm are true?

    1. A.

      The algorithm performs exactly 4 weight updates before converging.

    2. B.

      The final weight vector is .

    3. C.

      The algorithm performs exactly 3 weight updates before converging.

    4. D.

      The final bias term is .

    Correct Answer:

    ["A","B"]

    Step-by-Step Solution

    Key idea: This is a casework question tracing the Perceptron Learning Algorithm. The key is to carefully apply the update rule and condition for each point in each cycle, watching out for sign errors.

    Step 1: Cycle 1.

    Init: .

    : . Update 1: .

    : . No update.

    : . Update 2: .

    : . Update 3: .

    Step 2: Cycle 2.

    : . No update.

    : . Update 4: .

    : . No update.

    : . No update.

    Step 3: Cycle 3.

    : .

    : .

    All points are correctly classified. The algorithm converges.

    Total updates = 4. Final .

    Answer: A, B

    Question 6 · Machine Learning NAT

    Consider a 3-class Softmax regression model with weight matrix and no bias term. For a given input vector , the pre-activation scores are computed as . The true class label for this input is (using 1-based indexing for the classes).

    Let denote the cross-entropy loss for this single data point. What is the exact value of the partial derivative , where is the weight corresponding to class 2 and the second feature?

    Correct Answer:

    0.50

    Step-by-Step Solution

    Key idea: This is a matrix calculus question combining the Softmax function, cross-entropy loss, and the chain rule. The key is to correctly compute the Softmax probabilities, identify the one-hot target vector using the specified indexing, and apply the gradient formula for the specific weight element.

    Step 1: Compute the Softmax probabilities for each class.

    The scores are , , .

    The exponentials are , , .

    The sum of exponentials is .

    The probabilities are:

    Step 2: Determine the one-hot target vector .

    The true class is (1-based indexing). This means the first class is the target.

    The one-hot vector is .

    For class 2, the target indicator is .

    Step 3: Compute the gradient of the loss with respect to the score .

    The gradient of the cross-entropy loss with respect to the pre-activation score is:

    For :

    Step 4: Apply the chain rule to find the gradient with respect to the weight .

    The score is computed as .

    The partial derivative of with respect to is the second feature of the input:

    By the chain rule:

    Answer: 0.50

    Question 7 · Machine Learning NAT

    Consider a Lasso regression model with the objective function

    where and is an unregularized bias term. Given the training dataset:

    , , .

    Find the maximum value of the regularization parameter for which the optimal solution has at least one strictly non-zero weight (i.e., ). Round your answer to two decimal places.

    Correct Answer:

    1.33

    Step-by-Step Solution

    Key idea: This is a boundary condition problem in Lasso regression. The transition from non-zero weights to exactly zero weights occurs when the subgradient of the loss at is balanced by the penalty.

    Step 1: At the boundary where , the bias is unregularized, so it simply minimizes the unpenalized loss. The optimal is the mean of the targets: .

    Step 2: The gradient of the squared loss with respect to at and is .

    Step 3: Calculate the centered targets: .

    Step 4: Compute the gradient vector:

    .

    Step 5: For to be optimal, the subgradient of the penalty must contain the negative of this gradient. This requires for all .

    Step 6: The threshold value is . For any , at least one weight will be non-zero.

    Answer: 1.33

    Question 8 · Machine Learning MCQ

    A logistic regression model for binary classification uses features and . The correct decision function is:

    where , , . A point is classified as class 1 if , else class 0.

    Due to a sign error, the implemented model uses:

    For the following 4 test points, how many are classified differently by the correct vs. incorrect model?

    Points: , , ,

    1. A.

      0

    2. B.

      1

    3. C.

      2

    4. D.

      3

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: A sign error in one coefficient flips the decision boundary for points on one side, requiring case-by-case evaluation.

    Step 1: Compute the correct decision function for each point.

    • : class 1
    • : class 1
    • : class 0
    • : class 1

    Step 2: Compute the incorrect decision function for each point.

    • : class 1
    • : class 0
    • : class 0
    • : class 0

    Step 3: Compare classifications.

    • : both class 1 → same
    • : correct = class 1, wrong = class 0 → different
    • : both class 0 → same
    • : correct = class 1, wrong = class 0 → different

    Number of different classifications: 2

    Answer: 2

    Question 9 · Machine Learning MSQ

    Consider a regression dataset with a single feature and target , given by the points , , , and . We wish to build a decision tree of depth 1 (a single split) to minimize the sum of squared errors (SSE) in the child nodes. The possible split points are midway between consecutive values.

    Which of the following statements about the optimal split and its error are true?

    1. A.

      The optimal split is .

    2. B.

      The minimum sum of squared errors (SSE) achieved is 8.

    3. C.

      The optimal split is .

    4. D.

      If the global mean of is incorrectly used as the prediction for all leaves, the total SSE would be 20.

    Correct Answer:

    ["A","B"]

    Step-by-Step Solution

    Key idea: This is a decision tree regression question where the splitting criterion is the minimization of the sum of squared errors (SSE). The key is to evaluate the SSE for each possible split point using the correct leaf predictions (the mean of the target values in that leaf).

    Step 1: Evaluate the split .

    Left leaf: . Mean = 2. SSE = 0.

    Right leaf: . Mean = 20/3. SSE = .

    Total SSE = 56/3.

    Step 2: Evaluate the split .

    Left leaf: . Mean = 3. SSE = .

    Right leaf: . Mean = 8. SSE = .

    Total SSE = 10.

    Step 3: Evaluate the split .

    Left leaf: . Mean = 4. SSE = .

    Right leaf: . Mean = 10. SSE = 0.

    Total SSE = 8.

    Step 4: Check the distractor using the global mean.

    Global mean of .

    If we use 5.5 for all predictions: SSE = .

    The minimum SSE is 8, achieved at the split .

    Answer: A, B

    Question 10 · Machine Learning NAT

    Consider a binary decision tree that perfectly classifies the following dataset in using only axis-parallel splits of the form :

    .

    A student hypothesizes that a tree with 3 leaf nodes is sufficient to perfectly classify this data. This hypothesis leads to a contradiction because any valid root split leaves mixed classes on both sides, forcing both children to be internal nodes. Find the minimum number of leaf nodes required to perfectly classify this dataset.

    Correct Answer:

    4.00

    Step-by-Step Solution

    Key idea: This is a structural impossibility problem for decision trees. The XOR-like dataset cannot be separated by a single axis-parallel line, and we must prove that 3 leaves are insufficient by contradiction.

    Step 1: A binary tree with exactly 3 leaf nodes has exactly 2 internal nodes (the root and one child). This means only one split is applied after the root split.

    Step 2: Consider any axis-parallel root split, say . The left child contains and , which are mixed. The right child contains and , which are also mixed.

    Step 3: Since both children contain mixed classes, neither can be a leaf node. Both must be internal nodes requiring further splits.

    Step 4: If both children of the root are internal nodes, the tree must have at least leaf nodes. This contradicts the hypothesis that 3 leaf nodes are sufficient.

    Step 5: A tree with 4 leaf nodes is easily constructed (e.g., root , then split each child by ).

    Answer: 4.00

    More notes in this unit