k-Nearest Neighbors (k-NN) MCQs

By: Prof. Dr. Fazal Rehman Shamil | Last updated: August 7, 2024

1. What is the primary application of the k-Nearest Neighbors (k-NN) algorithm in data mining?
a) Clustering
b) Regression
c) Classification and Regression
d) Association rule mining

Answer: c) Classification and Regression

2. In the k-NN algorithm, what does the ‘k’ represent?
a) The number of features
b) The number of neighbors to consider
c) The size of the dataset
d) The depth of the decision tree

Answer: b) The number of neighbors to consider

3. Which distance metric is most commonly used in the k-NN algorithm?
a) Manhattan distance
b) Euclidean distance
c) Hamming distance
d) Cosine similarity

Answer: b) Euclidean distance

4. How does the k-NN algorithm classify a new data point?
a) By calculating the mean of the k nearest neighbors
b) By taking the majority vote of the k nearest neighbors
c) By using a decision tree
d) By clustering the data points

Answer: b) By taking the majority vote of the k nearest neighbors

5. What is a potential drawback of using the k-NN algorithm?
a) It is not suitable for large datasets due to high computational cost
b) It cannot handle numerical data
c) It requires a lot of pre-processing
d) It cannot be used for classification tasks

Answer: a) It is not suitable for large datasets due to high computational cost

6. How can the performance of the k-NN algorithm be affected by the choice of ‘k’?
a) Too small a ‘k’ can lead to overfitting
b) Too large a ‘k’ can lead to underfitting
c) Both a and b
d) The choice of ‘k’ does not affect the performance

Answer: c) Both a and b

7. What is the curse of dimensionality in the context of the k-NN algorithm?
a) The performance improves as the number of dimensions increases
b) The distance between data points becomes less meaningful as the number of dimensions increases
c) It refers to the difficulty of handling large datasets
d) It refers to the overfitting problem

Answer: b) The distance between data points becomes less meaningful as the number of dimensions increases

8. Which of the following methods can be used to select the optimal value of ‘k’ in the k-NN algorithm?
a) Cross-validation
b) Random selection
c) Using a fixed value
d) Mean squared error

Answer: a) Cross-validation

9. How does the k-NN algorithm handle continuous attributes?
a) By converting them to categorical data
b) By using distance metrics like Euclidean distance
c) By ignoring them
d) By normalizing them to binary values

Answer: b) By using distance metrics like Euclidean distance

10. What type of learning does the k-NN algorithm use?
a) Supervised learning
b) Unsupervised learning
c) Reinforcement learning
d) Semi-supervised learning

Answer: a) Supervised learning

More Next Data Mining MCQs

  1. Repeated Data Mining MCQs
  2. Classification in Data mining MCQs
  3. Clustering in Data mining MCQs
  4. Data Analysis and Experimental Design MCQs
  5. Basics of Data Science MCQs
  6. Big Data MCQs
  7. Caret Data Science MCQs 
  8. Binary and Count Outcomes MCQs
  9. CLI and Git Workflow

 

  1. Data Preprocessing MCQs
  2. Data Warehousing and OLAP MCQs
  3. Association Rule Learning MCQs
  4. Classification
  5. Clustering
  6. Regression MCQs
  7. Anomaly Detection MCQs
  8. Text Mining and Natural Language Processing (NLP) MCQs
  9. Web Mining MCQs
  10. Sequential Pattern Mining MCQs
  11. Time Series Analysis MCQs

Data Mining Algorithms and Techniques MCQs

  1. Frequent Itemset Mining MCQs
  2. Dimensionality Reduction MCQs
  3. Ensemble Methods MCQs
  4. Data Mining Tools and Software MCQs
  5. Python  Programming for Data Mining MCQs (Pandas, NumPy, Scikit-Learn)
  6. R Programming for Data Mining(dplyr, ggplot2, caret) MCQs
  7. SQL Programming for Data Mining for Data Mining MCQs
  8. Big Data Technologies MCQs