281 views
1 1 vote

We have a dataset of $1000$ points for a classification problem using the $k$-NN algorithm. Now consider the following statements:

S1: If $k=10$, it is enough if we store any $10$ points in the training dataset.

S2: If $k=10$, we need to store the entire dataset.

S3: The number of data points that we have to store increases as the size of $k$ increases.

S4: The number of data points that we have to store is independent of the value of $k$.

  1. S1 AND S3 ARE TRUE STATEMENTS
     
  2. S2 AND S4 ARE TRUE STATEMENTS
     
  3. S1 ALONE IS A TRUE STATEMENT
     
  4. S3 ALONE IS A TRUE STATEMENT

1 Answer

1 1 vote

The entire training dataset has to be stored in memory. For predicting the label of a test point, we have to perform the following steps:

  • Compute the distance of the test point from each training point.
     
  • Sort the training data points in ascending order of distance.
     
  • Choose the first $k$ points in this sequence.
     
  • Return that label which garners the maximum vote among these $k$ neighbors.
Answer:
Position:
Show:

Related questions

3 3 votes
1 1 answer
317
317 views
GO Classes asked Sep 30, 2025
317 views
Consider the following feature vectors:$$\mathbf{x}_1=\left[\begin{array}{c}1 \\2 \\1 \\-1\end{array}\right], \mathbf{x}_2=\left[\begin{array}{c}5 \\-3 \\-5 \\10\end{arra...
1 1 vote
1 1 answer
275
275 views
GO Classes asked Sep 30, 2025
275 views
The blue and the red points belong to two different classes. Both of them are a part of the training dataset. The black point at $(1,2)$ also belongs to the training data...
1 1 vote
1 1 answer
216
216 views
GO Classes asked Sep 30, 2025
216 views
The mean squared error of $\hat{w}_{M L}$ will be small ifThe eigenvalues of $X X^T$ are small. The eigenvalues of $\left(X X^T\right)^{-1}$ are large. The eigenvalues of...
0 0 votes
1 1 answer
196
196 views
GO Classes asked Sep 30, 2025
196 views
For a data set with $1000$ data points and $50$ features, how many models will be trained during Leave-One-Out cross-validation?