Classification

GATE DA previous year questions · 5 questions

GATE DA 2025 | Question 22

MCQ · 1 mark · −0.33

Consider designing a linear classifier

\[y = \operatorname{sign}(f(x; w, b)), \quad f(x; w, b) = w^{\top}x + b\]

on a dataset \(D = \{(x_{1}, y_{1}), (x_{2}, y_{2}), \ldots, (x_{N}, y_{N})\}\), \(x_{i} \in \mathbb{R}^{d}, y_{i} \in \{+1, -1\}, i = 1, 2, \ldots, N\). Recall that the sign function outputs +1 if the argument is positive, and \(-1\) if the argument is non-positive. The parameters \(w\) and \(b\) are updated as per the following training algorithm:

\[w_{new} = w_{old} + y_{n}x_{n}, \quad b_{new} = b_{old} + y_{n}\]

whenever \(\operatorname{sign}(f(x_{n}; w_{old}, b_{old})) \neq y_{n}\). In other words, whenever the classifier wrongly predicts a sample \((x_{n}, y_{n})\) from the dataset, \(w_{old}\) gets updated to \(w_{new}\), and likewise \(b_{old}\) gets updated to \(b_{new}\). Consider the case \((x_{n}, +1)\), \(f(x_{n}; w_{old}, b_{old}) < 0\). Then

Options for GATE DA 2025 | Question 22

Explanation

Answer: (A)

Here \(y_{n} = +1\), so the update adds the sample: \(w_{new} = w_{old} + x_{n}\) and \(b_{new} = b_{old} + 1\). Evaluate the new score on the same point:

\[f(x_{n}; w_{new}, b_{new}) = (w_{old} + x_{n})^{\top}x_{n} + b_{old} + 1 = f(x_{n}; w_{old}, b_{old}) + \lVert x_{n} \rVert^{2} + 1.\]

Since \(\lVert x_{n} \rVert^{2} + 1 \geq 1\), the score strictly increases, moving towards the correct positive side, so B and C are false. Option D fails because \(y_{n}f(x_{n}; w_{old}, b_{old}) = f(x_{n}; w_{old}, b_{old}) < 0\).

Answer: A

GATE DA 2025 | Question 55

MSQ · 2 marks

Consider a two-class problem in \(\mathbb{R}^{d}\) with class labels red and green. Let \(\mu_{\textit{red}}\) and \(\mu_{\textit{green}}\) be the means of the two classes. Given test sample \(x \in \mathbb{R}^{d}\), a classifier calculates the squared Euclidean distance (denoted by \(\| \cdot \|^{2}\)) between \(x\) and the means of the two classes and assigns the class label that the sample \(x\) is closest to. That is, the classifier computes

\[ f(x) = \|\mu_{\textit{red}} - x\|^{2} - \|\mu_{\textit{green}} - x\|^{2} \]

and assigns the label red to \(x\) if \(f(x) < 0\), and green otherwise. Which of the following statements is/are correct?

Options for GATE DA 2025 | Question 55

Explanation

Answer: (B), (C)

Expand each squared distance as \(\|\mu - x\|^{2} = \|\mu\|^{2} - 2\mu^{\top}x + \|x\|^{2}\). The \(\|x\|^{2}\) terms cancel in the difference:

\[ f(x) = 2(\mu_{\textit{green}} - \mu_{\textit{red}})^{\top}x + \|\mu_{\textit{red}}\|^{2} - \|\mu_{\textit{green}}\|^{2} \]

  • B and C hold: \(f(x) = w^{\top}x + b\) with \(w = 2(\mu_{\textit{green}} - \mu_{\textit{red}})\) and \(b = \|\mu_{\textit{red}}\|^{2} - \|\mu_{\textit{green}}\|^{2}\), so the decision boundary is a hyperplane.
  • D fails: the quadratic term cancels.
  • A fails: \(f(0) = \|\mu_{\textit{red}}\|^{2} - \|\mu_{\textit{green}}\|^{2} < 0\) when \(\|\mu_{\textit{red}}\| < \|\mu_{\textit{green}}\|\), so the origin gets the label red, the nearer mean.

Answer: B, C

GATE DA 2024 | Question 18

MCQ · 1 mark · −0.33

Match the items in Column 1 with the items in Column 2 in the following table:

Column 1Column 2
(p) Principal Component Analysis(i) Discriminative Model
(q) Naïve Bayes Classification(ii) Dimensionality Reduction
(r) Logistic Regression(iii) Generative Model
Options for GATE DA 2024 | Question 18

Explanation

Answer: (C)

Match each method by what it learns.

  • (p) Principal Component Analysis projects the data onto the few directions of largest variance, keeping most of the information in fewer features: dimensionality reduction, (ii).
  • (q) Naïve Bayes models how the data are generated, through \(P(\text{class})\) and \(P(\text{features} \mid \text{class})\), and gets the class from Bayes' theorem: a generative model, (iii).
  • (r) Logistic regression models \(P(\text{class} \mid \text{features})\) directly and never models the features themselves: a discriminative model, (i).

Options A and D call PCA a generative model, and B swaps the two classifiers.

Answer: C

GATE DA 2024 | Question 22

MCQ · 1 mark · −0.33

For any binary classification dataset, let \(S_{B} \in \mathbb{R}^{d \times d}\) and \(S_{W} \in \mathbb{R}^{d \times d}\) be the between-class and within-class scatter (covariance) matrices, respectively. The Fisher linear discriminant is defined by \(u^{*} \in \mathbb{R}^{d}\), that maximizes

\[J(u) = \frac{u^{T} S_{B} u}{u^{T} S_{W} u}\]

If \(\lambda = J(u^{*})\), \(S_{W}\) is non-singular and \(S_{B} \neq 0\), then \((u^{*}, \lambda)\) must satisfy which ONE of the following equations?

Note: \(\mathbb{R}\) denotes the set of real numbers.

Options for GATE DA 2024 | Question 22

Explanation

Answer: (A)

At the maximum the gradient of \(J\) is zero. Both matrices are symmetric, so by the quotient rule

\[\nabla J(u) = \frac{2 S_{B} u \,(u^{T} S_{W} u) - 2 S_{W} u \,(u^{T} S_{B} u)}{(u^{T} S_{W} u)^{2}} = 0 \;\Rightarrow\; S_{B} u^{*} = J(u^{*})\, S_{W} u^{*} = \lambda S_{W} u^{*}.\]

Since \(S_{W}\) is non-singular, multiplying by \(S_{W}^{-1}\) gives \(S_{W}^{-1} S_{B} u^{*} = \lambda u^{*}\): \(u^{*}\) is an eigenvector of \(S_{W}^{-1} S_{B}\) for its largest eigenvalue \(\lambda\).

Option B has \(\lambda\) on the wrong side (it would hold with \(1/\lambda\)), C multiplies by \(S_{W}\) instead of its inverse, and D fails because \(J\) does not depend on the length of \(u\), so \(u^{*}\) can be rescaled freely.

Answer: A

GATE DA 2024 | Question 53

MSQ · 2 marks

Consider the following figures representing datasets consisting of two-dimensional features with two classes denoted by circles and squares.

Four scatter plots labelled (i) to (iv), each with filled circles and filled squares on axes marked 1 to 3. In (i) circles are at (1, 3), (2, 3) and (1, 2) and squares at about (2, 1), (3, 1) and (2, 0.3); in (ii) a circle is at (2, 2) and squares at (1, 2), (3, 2), (2, 3) and (2, 1); in (iii) squares are at (1, 3) and (3, 1) and circles at (1, 1) and (3, 3); in (iv) squares are at about (1, 2.2), (1, 1.2) and (2, 2.6) and circles at about (2, 0.5), (3, 1.5) and (3, 0.6).

Which of the following is/are TRUE?

Options for GATE DA 2024 | Question 53

Explanation

Answer: (A), (D)

A dataset is linearly separable when a single straight line puts every circle on one side and every square on the other.

  • A holds: in (i) the circles have \(y \ge 2\) and the squares lie around \(y = 1\) or lower, so the line \(y = 1.6\) splits them.
  • B fails: in (ii) the circle at (2, 2) is the midpoint of the squares at (1, 2) and (3, 2). A half-plane holding both squares also holds their midpoint, so the circle cannot be cut off.
  • C fails: (iii) is the XOR pattern. The circles (1, 1), (3, 3) and the squares (1, 3), (3, 1) have the same midpoint (2, 2), which would have to lie on both sides.
  • D holds: in (iv) the squares sit to the upper left and the circles to the lower right, so a slanted line such as \(y = x - 0.3\) works.

Answer: A, D