GATE DA 2025 · Regression vs Classification Problems

MSQ · 2 marks · Problem ML-SUPV-0010

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. A
    The sample \(x = 0\) is assigned the label green if \(\|\mu_{red}\| < \|\mu_{green}\|\)
  2. B
    \(f\) is a linear function of \(x\)
  3. C
    \(f(x) = w^T x + b\), where \(w\) and \(b\) are functions of \(\mu_{red}\) and \(\mu_{green}\)
  4. D
    \(f\) is a quadratic polynomial in \(x\)

Solve it on GATE DA practice →More Supervised Learning — Regression problems

Show the worked solutionA natural nearest-centroid discriminant is \(f(x)=\|x-\mu_{\text{green}}\|^2-\|x-\mu_{\text{red}}\|^2\). Expanding:\(f(x)=\big(\|x\|^2-2\mu_{\text{green}}^Tx+\|\mu_{\text{green}}\|^2\big)-\big(\|x\|^2-2\mu_{\text{red}}^Tx+\|\mu_{\text{red}}\|^2\big)\)\(=2(\mu_{\text{red}}-\mu_{\text{green}})^Tx+\big(\|\mu_{\text{green}}\|^2-\|\mu_{\text{red}}\|^2\big)\)The quadratic \(\|x\|^2\) terms cancel exactly — so \(f\) is linear in \(x\), of the form \(f(x)=w^Tx+b\) with \(w=2(\mu_{\text{red}}-\mu_{\text{green}})\) and \(b=\|\mu_{\text{green}}\|^2-\|\mu_{\text{red}}\|^2\) (both functions of the class means) — not quadratic.At \(x=0\): \(f(0)=b=\|\mu_{\text{green}}\|^2-\|\mu_{\text{red}}\|^2\). If \(\|\mu_{\text{red}}\|0\), meaning \(x=0\) is farther from the green centroid than the red one — so it should be classified red, not green as the option incorrectly claims.Answer: B, C

GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com