Artificial Intelligence Machine Learning Fundamentals 2 — Questions and Answers
Question 1: Which distance metric is commonly used in the K-Nearest Neighbors algorithm?
- Manhattan distance
- Cosine similarity
- Euclidean distance (Correct answer)
- Hamming distance
Correct answer: Euclidean distance
Euclidean distance is the standard metric used in KNN to measure similarity between data points in feature space.
Question 2: What is the purpose of a train/test split in machine learning?
- To speed up training time
- To evaluate model performance on unseen data (Correct answer)
- To reduce the number of features
- To balance class distribution
Correct answer: To evaluate model performance on unseen data
A train/test split reserves a portion of data unseen during training to provide an unbiased evaluation of the model.
Question 3: Which of the following is a regularization technique that adds the sum of absolute values of coefficients to the loss function?
- Ridge (L2)
- Dropout
- Lasso (L1) (Correct answer)
- Elastic Net
Correct answer: Lasso (L1)
Lasso (L1) regularization adds the sum of absolute coefficient values, which can shrink some coefficients to exactly zero.
Question 4: What does 'feature scaling' accomplish in machine learning preprocessing?
- It removes outliers from the dataset
- It brings features to a comparable range to prevent scale dominance (Correct answer)
- It encodes categorical variables as numbers
- It splits the data into train and test sets
Correct answer: It brings features to a comparable range to prevent scale dominance
Feature scaling ensures no single feature dominates due to larger magnitude, improving convergence and model fairness.
Question 5: Which algorithm is best described as finding the hyperplane that maximizes the margin between two classes?
- Decision tree
- Logistic regression
- Support Vector Machine (Correct answer)
- K-means
Correct answer: Support Vector Machine
Support Vector Machines find the optimal separating hyperplane by maximizing the margin between the closest data points of each class.
Question 6: What is 'gradient descent' in the context of training machine learning models?
- A method for selecting the best features
- An optimization algorithm that iteratively reduces loss by moving in the direction of steepest descent (Correct answer)
- A technique for splitting decision trees
- A metric for measuring model accuracy
Correct answer: An optimization algorithm that iteratively reduces loss by moving in the direction of steepest descent
Gradient descent iteratively adjusts model parameters in the opposite direction of the loss gradient to minimize the loss function.
Which distance metric is commonly used in the K-Nearest Neighbors algorithm?