chapter

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

    Chapter 2 — Unit 1 — 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 the ridge regression objective

    with , , , and . Starting from , perform one step of gradient descent with learning rate . What is the value of ?

    Question 2
    Level 4: Challenger

    Consider a binary classification dataset with support vectors with label and with label . The optimal separating hyperplane for a hard-margin SVM has weight vector and bias .

    Find the margin width of this SVM classifier.

    Question 3
    Level 4: Challenger

    Consider a ridge regression model with regularization parameter fitted on a centered dataset with observations and predictors. The effective degrees of freedom is defined as

    Let be the singular values of the design matrix .

    Which of the following expressions correctly evaluate to ?

    Question 4
    Level 4: Challenger

    Consider a dataset with features and covariance matrix . Let be the eigenvalues of . The total variance captured by the first principal components can be expressed in multiple equivalent forms.

    Which of the following expressions correctly evaluate to the total variance captured by the first principal components?

    Question 5
    Level 4: Challenger

    Consider the polynomial kernel defined on . Let be the implicit feature map into a higher-dimensional space corresponding to this kernel. Given the points and , find the squared Euclidean distance between their mapped representations.

    Question 6
    Level 4: Challenger

    Consider a binary classification dataset with 6 points in :

    A linear classifier predicts if and otherwise, where . The F1 score is

    Find the maximum possible F1 score over all with .

    Question 7
    Level 4: Challenger

    A dataset contains four points with a single feature and binary label :

    Consider decision stumps that split at threshold , predicting if and otherwise. The Gini impurity of a node with class proportions and is . For a split, the overall impurity is the weighted average of the Gini impurities of the two child nodes, weighted by the number of points in each.

    Find the number of thresholds in for which the overall Gini impurity of the split is strictly less than $0.5$.

    Question 8
    Level 4: Challenger

    Consider a binary classification dataset in with labels :

    A -nearest neighbors classifier with uses Euclidean distance. For each point, the classifier finds the 3 nearest neighbors from the remaining points and predicts the majority label among them.

    Find the total number of misclassified points in this dataset.

    Question 9
    Level 4: Challenger

    Consider a dataset with 3 points in : with label , with label , and with label . A linear classifier predicts where if and if .

    Which of the following statements about the number of misclassified points are correct?

    Question 10
    Level 4: Challenger

    Consider a binary classification dataset with 6 points in :

    A linear classifier predicts if and otherwise, where .

    Find the minimum possible number of misclassified points over all with .

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

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

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

    Question 1 · Machine Learning MCQ

    Consider the ridge regression objective

    with , , , and . Starting from , perform one step of gradient descent with learning rate . What is the value of ?

    1. A.

      1.10

    2. B.

      1.20

    3. C.

      1.40

    4. D.

      1.60

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a gradient descent update on a ridge regression objective. The gradient has two components: the data-fitting term and the regularization term. Both must be included with correct coefficients.

    Step 1: Write the objective clearly.

    Step 2: Compute the gradient with respect to .

    Step 3: Substitute the given values , , .

    Step 4: Evaluate the gradient at .

    Step 5: Perform the gradient descent update.

    Answer: 1.20

    Question 2 · Machine Learning MCQ

    Consider a binary classification dataset with support vectors with label and with label . The optimal separating hyperplane for a hard-margin SVM has weight vector and bias .

    Find the margin width of this SVM classifier.

    1. A.

    2. B.

    3. C.

    4. D.

      $2$

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a direct application of the SVM margin formula. The margin width is the distance between the two supporting hyperplanes, which equals .

    Step 1: Recall the margin formula for a hard-margin SVM.

    The margin width is the distance between the hyperplanes and .

    Step 2: Compute .

    Given :

    Step 3: Calculate the margin.

    Step 4: Verify with support vectors.

    For : ✓

    For : ✓

    Both support vectors lie on their respective supporting hyperplanes.

    Answer:

    Question 3 · Machine Learning MSQ

    Consider a ridge regression model with regularization parameter fitted on a centered dataset with observations and predictors. The effective degrees of freedom is defined as

    Let be the singular values of the design matrix .

    Which of the following expressions correctly evaluate to ?

    1. A.

      \sum_{j=1}^p rac{d_j^2}{d_j^2 + \lambda}

    2. B.

      ext{Tr}\left( (X^T X + \lambda I_p)^{-1} X^T X ight)

    3. C.

      p - \lambda \sum_{j=1}^p rac{1}{d_j^2 + \lambda}

    4. D.

      ext{Tr}\left( (X^T X - \lambda I_p)^{-1} X^T X ight)

    Correct Answer:

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

    Step-by-Step Solution

    Key idea: This is a direct application of matrix trace properties and the spectral decomposition of to simplify the effective degrees of freedom formula for ridge regression. The cyclic property of the trace and the relationship between singular values and eigenvalues allow us to rewrite the expression in multiple equivalent forms.

    Step 1: Apply the cyclic property of the trace, .

    Let , , and .

    This confirms Option B.

    Step 2: Use the eigen-decomposition of .

    Since is symmetric positive semi-definite, it can be decomposed as , where is orthogonal and contains the eigenvalues (squares of the singular values of ).

    Substitute this into the expression from Step 1:

    Step 3: Compute the trace.

    The trace is invariant under orthogonal transformations, so:

    Since is a diagonal matrix with entries , the trace is the sum of these diagonal entries:

    This confirms Option A.

    Step 4: Algebraic manipulation.

    Rewrite each term in the sum from Option A:

    Summing over all terms:

    This confirms Option C.

    Step 5: Evaluate Option D.

    Option D uses in the inverse, which corresponds to a negative regularization parameter. This is incorrect for ridge regression and would lead to an ill-posed problem if .

    Answer: A, B, C

    Question 4 · Machine Learning MSQ

    Consider a dataset with features and covariance matrix . Let be the eigenvalues of . The total variance captured by the first principal components can be expressed in multiple equivalent forms.

    Which of the following expressions correctly evaluate to the total variance captured by the first principal components?

    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    ["A","B"]

    Step-by-Step Solution

    Key idea: This is a direct application of PCA variance decomposition. The total variance in the dataset equals the trace of the covariance matrix, which equals the sum of all eigenvalues. The variance captured by the first principal components is the sum of the first eigenvalues.

    Step 1: Recall the total variance.

    The total variance in the dataset is .

    Step 2: Variance captured by first PCs.

    The -th principal component has variance . Therefore, the total variance captured by the first PCs is:

    This confirms Option A.

    Step 3: Alternative form using the trace.

    Since , we can write:

    This confirms Option B.

    Step 4: Evaluate Option C.

    Option C gives , which is the fraction of variance explained, not the absolute variance. This is a different quantity (always between 0 and 1).

    Step 5: Evaluate Option D.

    Option D gives , which squares each eigenvalue. This is incorrect because the variance of each PC is , not .

    Answer: A, B

    Question 5 · Machine Learning NAT

    Consider the polynomial kernel defined on . Let be the implicit feature map into a higher-dimensional space corresponding to this kernel. Given the points and , find the squared Euclidean distance between their mapped representations.

    Correct Answer:

    37.00

    Step-by-Step Solution

    Key idea: This is a kernel trick application. The squared distance in the feature space can be computed entirely in the input space using the kernel function, without explicitly constructing the feature map . The formula is .

    Step 1: Compute the dot products in the input space.

    Step 2: Evaluate the kernel for each pair.

    Step 3: Apply the distance formula in the feature space.

    Answer: 37.00

    Question 6 · Machine Learning NAT

    Consider a binary classification dataset with 6 points in :

    A linear classifier predicts if and otherwise, where . The F1 score is

    Find the maximum possible F1 score over all with .

    Correct Answer:

    0.86

    Step-by-Step Solution

    Key idea: in , a linear classifier has a single decision boundary at . The sign of decides whether we predict on the right () or on the left () of . Only the ordering of the matters, so there are finitely many distinct classifiers — one per gap between consecutive sorted -values, plus the two outer rays.

    Exam route:

    Sort the data by : . There are 7 intervals for :

    .

    For each interval, try both (predict to the right of ) and (predict to the left of ), compute and hence .

    Case (predict for ):

    • : predicted on , predicted on .

    .

    • : .
    • : .
    • : .
    • : .
    • or : .

    Case (predict for ): by symmetry the best is at .

    The global maximum is , achieved at any with .

    Answer: 0.86

    Question 7 · Machine Learning MCQ

    A dataset contains four points with a single feature and binary label :

    Consider decision stumps that split at threshold , predicting if and otherwise. The Gini impurity of a node with class proportions and is . For a split, the overall impurity is the weighted average of the Gini impurities of the two child nodes, weighted by the number of points in each.

    Find the number of thresholds in for which the overall Gini impurity of the split is strictly less than $0.5$.

    1. A.

      0

    2. B.

      1

    3. C.

      2

    4. D.

      3

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a decision tree split evaluation problem. For each threshold, partition the data into left () and right () child nodes, compute the Gini impurity of each child, then take the weighted average. Count how many splits have weighted Gini .

    Step 1: Recall Gini impurity .

    Step 2: Evaluate each split.

    <b>Split at :</b>

    Left (): . , , . .

    Right (): . , , . .

    Weighted Gini: . ✓

    <b>Split at :</b>

    Left (): . , , . .

    Right (): . , , . .

    Weighted Gini: . Not . ✗

    <b>Split at :</b>

    Left (): . , , . .

    Right (): . , , . .

    Weighted Gini: . ✓

    Step 3: Count the splits with weighted Gini . Two splits ( and ) qualify.

    Answer: 2

    Question 8 · Machine Learning MCQ

    Consider a binary classification dataset in with labels :

    A -nearest neighbors classifier with uses Euclidean distance. For each point, the classifier finds the 3 nearest neighbors from the remaining points and predicts the majority label among them.

    Find the total number of misclassified points in this dataset.

    1. A.

      0

    2. B.

      1

    3. C.

      2

    4. D.

      3

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a casework problem tracing the -NN algorithm. For each point, compute distances to all other points, identify the nearest neighbors, and determine the majority vote. Count how many predictions disagree with the true labels.

    Step 1: Process point , .

    Distances to other points:

    • To :
    • To :
    • To :
    • To :

    3 nearest neighbors: , , (tie broken arbitrarily, but majority is ).

    Prediction: . True: . ✓ Correct.

    Step 2: Process point , .

    Distances:

    • To : $2$
    • To :
    • To :
    • To :

    3 nearest neighbors: , , .

    Majority: . Prediction: . True: . ✓ Correct.

    Step 3: Process point , .

    Distances:

    • To : $2$
    • To :
    • To :
    • To :

    3 nearest neighbors: , , .

    Majority: . Prediction: . True: . ✓ Correct.

    Step 4: Process point , .

    Distances:

    • To : $3$
    • To : $1$
    • To :
    • To :

    3 nearest neighbors: , , .

    Majority: . Prediction: . True: . ✗ Misclassified.

    Step 5: Process point , .

    Distances:

    • To : $3$
    • To :
    • To : $1$
    • To :

    3 nearest neighbors: , , .

    Majority: . Prediction: . True: . ✗ Misclassified.

    Step 6: Count misclassified points.

    Points and are misclassified. Total = 2.

    Answer: 2

    Question 9 · Machine Learning MSQ

    Consider a dataset with 3 points in : with label , with label , and with label . A linear classifier predicts where if and if .

    Which of the following statements about the number of misclassified points are correct?

    1. A.

      With , exactly 2 points are misclassified

    2. B.

      With , exactly 1 point is misclassified

    3. C.

      With , exactly 1 point is misclassified

    4. D.

      With , exactly 2 points are misclassified

    Correct Answer:

    ["A","B"]

    Step-by-Step Solution

    Key idea: This is a casework problem evaluating a linear classifier. For each value of , compute the prediction for each point and compare with the true label . Count mismatches.

    Step 1: Evaluate with .

    • : . True: . Misclassified.
    • : . True: . Misclassified.
    • : . True: . Correct.

    Total misclassified with : 2 points ( and ). This confirms Option A.

    Step 2: Evaluate with .

    • : . True: . Correct.
    • : . True: . Correct.
    • : . True: . Misclassified.

    Total misclassified with : 1 point (). This confirms Option B.

    Step 3: Evaluate Options C and D.

    Option C claims 1 misclassified with , but we found 2. Incorrect.

    Option D claims 2 misclassified with , but we found 1. Incorrect.

    Answer: A, B

    Question 10 · Machine Learning NAT

    Consider a binary classification dataset with 6 points in :

    A linear classifier predicts if and otherwise, where .

    Find the minimum possible number of misclassified points over all with .

    Correct Answer:

    2.00

    Step-by-Step Solution

    Key idea: the labels alternate along the line, so no single threshold can separate the two classes. We must prove 0 is impossible and then find the true minimum by a threshold sweep.

    Why 0 is impossible (contradiction): suppose some classifies all 6 points correctly. The decision boundary splits into two half-lines, each assigned a single label. But the sequence has no contiguous block of one label that contains all 's and excludes all 's — whichever side of you call '', it either misses a or includes a . Contradiction. So the minimum is .

    Exam route: sweep the 7 intervals for and both signs of . Count misclassifications directly.

    Case (predict for ):

    • : all errors at .
    • : predict on errors at .
    • : predict on errors at .
    • : predict on errors at .
    • : predict on errors at .
    • : predict on errors at .
    • : all errors at .

    Case (predict for ):

    • : all .
    • : predict on , on errors at .
    • : predict on errors at .
    • : predict on errors at .
    • : predict on errors at .
    • : predict on errors at .
    • : all .

    The global minimum is $2$, achieved (for example) at with .

    Answer: 2.00

    More notes in this unit