The GATE Grind

GATE 2025 DA – Question 55

Machine Learning · Supervised learning: classification · 2 marks · Multiple select

Consider a two-class problem in $\mathbb{R}^d$ with class labels red and green. Let $\mu_{red}$ and $\mu_{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_{red} - x\|^2 - \|\mu_{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?

  1. The sample $x = 0$ is assigned the label green if $\|\mu_{red}\| < \|\mu_{green}\|$
  2. $f$ is a linear function of $x$
  3. $f(x) = w^\top x + b$, where $w$ and $b$ are functions of $\mu_{red}$ and $\mu_{green}$
  4. $f$ is a quadratic polynomial in $x$

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) $f$ is a linear function of $x$; (C) $f(x) = w^\top x + b$, where $w$ and $b$ are functions of $\mu_{red}$ and $\mu_{green}$

Explanation

Expanding, $f(x) = \|\mu_{red}\|^2 - 2\mu_{red}^\top x - \|\mu_{green}\|^2 + 2\mu_{green}^\top x$, since the $\|x\|^2$ terms cancel. So $f(x) = w^\top x + b$ with $w = 2(\mu_{green} - \mu_{red})$ and $b = \|\mu_{red}\|^2 - \|\mu_{green}\|^2$. It is a linear function of $x$ (B and C are true) and not quadratic (D is false). At $x = 0$, $f(0) = b = \|\mu_{red}\|^2 - \|\mu_{green}\|^2$, which is negative if $\|\mu_{red}\| < \|\mu_{green}\|$, and then the label is red, not green (A is false).