chapter

    Chapter 1 — Unit 1 — Machine Learning Practice Questions for Gate Da

    Solve 10+ Chapter 1 — Unit 1 — Machine Learning practice questions for GATE DA with answers and detailed solutions. Free sample questions below.

    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 binary classification dataset in 1D with three points: with label , with label , and with label . A hard-margin linear Support Vector Machine is trained on this data to find the maximum margin hyperplane . What is the value of for the optimal parameters?

    Question 2
    Level 4: Challenger

    Consider a 1D linear regression model (with no bias term) trained on two data points: and . The loss function is defined as . We use gradient descent with a learning rate starting from . Which of the following quantities are correct?

    Question 3
    Level 4: Challenger

    Consider a linear regression problem with a design matrix whose columns are orthogonal. The squared norms of the columns are and . The projections of the target vector onto these columns are and . If Ridge regression is applied with a regularization parameter , what is the value of the estimated coefficient ?

    Question 4
    Level 4: Challenger

    Consider a two-class classification problem where the features follow multivariate Gaussian distributions with a shared covariance matrix. Class 0 has mean and Class 1 has mean . The shared covariance matrix is . Using Linear Discriminant Analysis (LDA) with equal class priors, the decision boundary is a line of the form . What is the value of on this decision boundary when ?

    Question 5
    Level 4: Challenger

    Consider a dataset with two points and . We use the polynomial kernel and train a Kernel Ridge Regression model with regularization parameter . By the representer theorem, the prediction function is . Which of the following are the correct values for the respective quantities?

    Question 6
    Level 4: Challenger

    Consider a dataset with a covariance matrix . We perform Principal Component Analysis (PCA) on this data. Which of the following statements about the principal components and their variances are correct?

    Question 7
    Level 4: Challenger

    Consider a binary classification dataset with two binary features and . The dataset contains 5 samples: 4 samples belong to class and 1 sample belongs to class . In the class , the feature appears in 3 samples and appears in 2 samples. In the class , the feature appears in 0 samples and appears in 0 samples. A Naive Bayes classifier with Laplace smoothing () is trained on this data. For a test sample with and , what is the predicted posterior probability ? (Round off to 2 decimal places)

    Question 8
    Level 4: Challenger

    Consider a binary classification dataset with samples, where of the samples belong to class $1$ and belong to class $0$. We wish to split this dataset into two disjoint subsets of equal size using a binary feature. What is the maximum possible Information Gain (in bits) from this split?

    (Note: Use for entropy calculations. Round off to two decimal places.)

    Question 9
    Level 4: Challenger

    Consider the dataset with points ; ; . These points are mapped to a higher-dimensional feature space using . A perceptron algorithm is trained in this feature space with initial weights and bias , using the update rule and whenever . How many weight updates occur before the algorithm converges?

    Question 10
    Level 4: Challenger

    Consider a dataset with distinct data points. A bootstrap sample of size $3$ is generated by sampling with replacement from this dataset. Since the learning algorithm is invariant to the order of training instances, two bootstrap samples are considered identical if they contain the same multiset of data points.

    What is the minimum number of bootstrap samples that must be generated to guarantee that at least two of them are identical?

    Free preview ends here

    Login to view the complete practice questions and solutions

    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 — Unit 1 — Machine Learning Practice Questions for GATE DA

    Solve 10+ Chapter 1 — Unit 1 — Machine Learning practice questions for GATE DA with answers and detailed solutions. Free sample questions below.

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

    Question 1 · Machine Learning MCQ

    Consider a binary classification dataset in 1D with three points: with label , with label , and with label . A hard-margin linear Support Vector Machine is trained on this data to find the maximum margin hyperplane . What is the value of for the optimal parameters?

    1. A.

      -3

    2. B.

      3

    3. C.

      5

    4. D.

      1.8

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: The maximum margin hyperplane is determined by the support vectors, which are the points closest to the decision boundary. We must identify the correct support vectors by checking the margin constraints .

    Step 1: Assume the support vectors are and . The constraints are tight: .

    For : .

    For : .

    Step 2: Solve the system. Adding the two equations: .

    Substitute into the second equation: .

    Step 3: Verify the constraint for the remaining point .

    .

    Since , the constraint is satisfied, confirming and are the true support vectors.

    Step 4: Calculate the requested value.

    .

    Answer: 5

    Question 2 · Machine Learning MSQ

    Consider a 1D linear regression model (with no bias term) trained on two data points: and . The loss function is defined as . We use gradient descent with a learning rate starting from . Which of the following quantities are correct?

    1. A.

      The gradient of the loss function at is

    2. B.

      The value of after one gradient descent update is $1$

    3. C.

      The value of after one gradient descent update is

    4. D.

      The gradient of the loss function at the optimal is $0$

    Correct Answer:

    ["A","B","D"]

    Step-by-Step Solution

    Key idea: This is a gradient descent problem for linear regression. We need to compute the loss function, its gradient, and perform the update step, being careful with the signs.

    Step 1: Write the explicit loss function.

    .

    Expanding this: .

    Step 2: Compute the gradient.

    .

    At , . Option A is correct.

    Step 3: Perform the gradient descent update.

    . Option B is correct.

    Option C claims . This is the result of a sign error in the gradient (e.g., using , which gives ). This is incorrect.

    Step 4: Find the gradient at the optimal .

    The optimal minimizes , so .

    At this optimal , the gradient is indeed $0$. Option D is correct.

    Answer: A, B, D

    Question 3 · Machine Learning MCQ

    Consider a linear regression problem with a design matrix whose columns are orthogonal. The squared norms of the columns are and . The projections of the target vector onto these columns are and . If Ridge regression is applied with a regularization parameter , what is the value of the estimated coefficient ?

    1. A.

      1.33

    2. B.

      3.00

    3. C.

      1.67

    4. D.

      0.67

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: For orthogonal features, the Ridge regression coefficient is simply the OLS coefficient shrunk by the factor .

    Step 1: Compute the OLS coefficient for . Since the columns are orthogonal, .

    Step 2: Apply the Ridge shrinkage factor. The Ridge estimate is .

    Answer: 1.33

    Question 4 · Machine Learning MCQ

    Consider a two-class classification problem where the features follow multivariate Gaussian distributions with a shared covariance matrix. Class 0 has mean and Class 1 has mean . The shared covariance matrix is . Using Linear Discriminant Analysis (LDA) with equal class priors, the decision boundary is a line of the form . What is the value of on this decision boundary when ?

    1. A.

      4

    2. B.

      5

    3. C.

      6

    4. D.

      -5

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: The LDA decision boundary for equal priors is a hyperplane orthogonal to passing through the midpoint .

    Step 1: Compute the inverse of the covariance matrix.

    .

    Step 2: Compute the normal vector .

    .

    Step 3: Determine the equation of the boundary. It passes through the midpoint .

    .

    Multiplying by 3 gives .

    Step 4: Substitute to find .

    .

    Answer: 5

    Question 5 · Machine Learning MSQ

    Consider a dataset with two points and . We use the polynomial kernel and train a Kernel Ridge Regression model with regularization parameter . By the representer theorem, the prediction function is . Which of the following are the correct values for the respective quantities?

    1. A.

      The value of the kernel entry is $0$

    2. B.

      The value of the coefficient lpha_1 is

    3. C.

      The value of the prediction is

    4. D.

      The value of the coefficient lpha_1 is

    Correct Answer:

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

    Step-by-Step Solution

    Key idea: This is a Kernel Ridge Regression problem, recognizable by the combination of a kernel function, a regularization parameter , and the representer theorem. The solution requires computing the kernel matrix, adding , and solving the linear system.

    Step 1: Compute the kernel matrix .

    So, . Option A is correct.

    Step 2: Compute the coefficients .

    The Kernel Ridge Regression formula is .

    .

    .

    So . Option B is correct.

    Step 3: Compute the prediction at .

    . Option C is correct.

    Step 4: Identify the trap.

    If one forgets to add and solves , they get , which matches Option D. This is incorrect.

    Answer: A, B, C

    Question 6 · Machine Learning MSQ

    Consider a dataset with a covariance matrix . We perform Principal Component Analysis (PCA) on this data. Which of the following statements about the principal components and their variances are correct?

    1. A.

      The eigenvalues of are $6$ and $1$

    2. B.

      The fraction of the total variance explained by the first principal component is

    3. C.

      The direction of the first principal component is

    4. D.

      The fraction of the total variance explained by the second principal component is

    Correct Answer:

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

    Step-by-Step Solution

    Key idea: This is a PCA problem requiring the computation of eigenvalues and eigenvectors of the covariance matrix to find the principal components and their explained variances.

    Step 1: Find the eigenvalues of .

    The characteristic equation is .

    The roots are and . Option A is correct.

    Step 2: Find the explained variance fractions.

    The total variance is the trace of , which is (or ).

    The fraction explained by the first PC is . Option B is correct.

    The fraction explained by the second PC is . Option D claims it is , which is incorrect (this is a common mistake of using the wrong eigenvalue in the formula).

    Step 3: Find the direction of the first principal component.

    Solve .

    This gives .

    So the eigenvector is . Normalized, it is . Option C is correct.

    Answer: A, B, C

    Question 7 · Machine Learning NAT

    Consider a binary classification dataset with two binary features and . The dataset contains 5 samples: 4 samples belong to class and 1 sample belongs to class . In the class , the feature appears in 3 samples and appears in 2 samples. In the class , the feature appears in 0 samples and appears in 0 samples. A Naive Bayes classifier with Laplace smoothing () is trained on this data. For a test sample with and , what is the predicted posterior probability ? (Round off to 2 decimal places)

    Correct Answer:

    0.92

    Step-by-Step Solution

    Key idea: This is a Naive Bayes classification problem with Laplace smoothing, recognizable by the need to compute posterior probabilities from feature counts and the explicit mention of smoothing to handle zero counts.

    Step 1: Identify the priors. There are 5 samples total: 4 for and 1 for . Thus, and .

    Step 2: Compute the conditional probabilities with Laplace smoothing (). The formula is , where is the number of feature values.

    For :

    .

    .

    For :

    .

    .

    Step 3: Compute the unnormalized posteriors (numerator of Bayes' theorem).

    Numerator for : .

    Numerator for : .

    Step 4: Normalize to find the posterior probability for .

    Total evidence = .

    .

    Answer: 0.92

    Question 8 · Machine Learning NAT

    Consider a binary classification dataset with samples, where of the samples belong to class $1$ and belong to class $0$. We wish to split this dataset into two disjoint subsets of equal size using a binary feature. What is the maximum possible Information Gain (in bits) from this split?

    (Note: Use for entropy calculations. Round off to two decimal places.)

    Correct Answer:

    0.31

    Step-by-Step Solution

    Key idea: Information Gain is . To maximize it, we must minimize the conditional entropy subject to the hard constraint on the total number of class samples.

    Step 1: Calculate the initial entropy .

    , so .

    bits.

    Step 2: Set up the split constraints.

    The split creates two subsets, and , each of size .

    Let be the number of class $1$ samples in . Since there are only class $1$ samples in total, we must have .

    Step 3: Express conditional entropy in terms of .

    The fraction of class $1$ in is . Given the constraint on , .

    The fraction of class $1$ in is .

    The conditional entropy is .

    Step 4: Minimize over the valid interval.

    The entropy function is strictly concave. Therefore, is also strictly concave.

    The minimum of a strictly concave function on a closed interval must occur at one of the boundaries, i.e., or .

    At , .

    So, the minimum conditional entropy is bits.

    Step 5: Calculate maximum Information Gain.

    Max IG = .

    Answer: 0.31

    Question 9 · Machine Learning MCQ

    Consider the dataset with points ; ; . These points are mapped to a higher-dimensional feature space using . A perceptron algorithm is trained in this feature space with initial weights and bias , using the update rule and whenever . How many weight updates occur before the algorithm converges?

    1. A.

      3

    2. B.

      4

    3. C.

      5

    4. D.

      6

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This requires synthesizing the kernel feature mapping with the step-by-step casework of the perceptron convergence algorithm.

    Step 1: Map the points to the feature space: , , .

    Step 2: Trace the perceptron algorithm.

    • Init: .
    • : . Update: .
    • : . Update: .
    • : . Update: . (End of Epoch 1, 3 updates)
    • Epoch 2, : . No update.
    • Epoch 2, : . Update: . (4th update)
    • Epoch 2, : . No update.
    • Epoch 3: All points are correctly classified with margin . The algorithm converges.

    Answer: 4

    Question 10 · Machine Learning NAT

    Consider a dataset with distinct data points. A bootstrap sample of size $3$ is generated by sampling with replacement from this dataset. Since the learning algorithm is invariant to the order of training instances, two bootstrap samples are considered identical if they contain the same multiset of data points.

    What is the minimum number of bootstrap samples that must be generated to guarantee that at least two of them are identical?

    Correct Answer:

    11

    Step-by-Step Solution

    Key idea: This is a Pigeonhole Principle problem applied to the number of distinct multisets (combinations with replacement) of size from elements.

    Step 1: Identify the nature of a bootstrap sample.

    A bootstrap sample of size drawn with replacement from distinct elements is a multiset of size . Order does not matter because the learning algorithm is invariant to instance order.

    Step 2: Calculate the number of distinct possible bootstrap samples.

    The number of ways to choose items from types with replacement is given by the stars and bars formula: .

    Here, (distinct data points) and (sample size).

    Number of distinct multisets = .

    Step 3: Apply the Pigeonhole Principle.

    We have 10 distinct "pigeonholes" (possible multisets). To guarantee that at least two "pigeons" (generated samples) fall into the same hole (are identical), we need one more sample than the number of holes.

    Minimum samples = .

    Answer: 11

    More practice questions in this unit