CS CS Artificial Intelligence & Machine Learning 1 — Questions and Answers
Question 1: Which type of machine learning algorithm learns from labeled training data to predict outcomes on new data?
- Reinforcement Learning
- Unsupervised Learning
- Supervised Learning (Correct answer)
- Self-supervised Learning
Correct answer: Supervised Learning
Supervised learning uses labeled input-output pairs to train a model that can then predict labels for unseen inputs.
Question 2: What is the vanishing gradient problem in deep neural networks?
- Weights grow too large during backpropagation
- Gradients shrink exponentially as they propagate backward, halting learning in early layers (Correct answer)
- The network overfits to training data
- Activation functions return zero for all inputs
Correct answer: Gradients shrink exponentially as they propagate backward, halting learning in early layers
The vanishing gradient problem occurs when gradients become extremely small during backpropagation, preventing early layers from learning effectively.
Question 3: In a decision tree, what does 'pruning' accomplish?
- Adds more leaf nodes to increase accuracy
- Removes branches to reduce overfitting and improve generalization (Correct answer)
- Reorders tree branches alphabetically
- Duplicates subtrees to improve recall
Correct answer: Removes branches to reduce overfitting and improve generalization
Pruning removes branches from a decision tree that have little predictive power, reducing model complexity and overfitting.
Question 4: Which distance metric is most commonly used in k-Nearest Neighbors (kNN) for continuous features?
- Hamming Distance
- Jaccard Distance
- Euclidean Distance (Correct answer)
- Cosine Similarity
Correct answer: Euclidean Distance
Euclidean distance measures the straight-line distance between two points in feature space and is the default metric for kNN with continuous data.
Question 5: What is the purpose of a confusion matrix in evaluating a classification model?
- It visualizes the loss curve during training
- It shows the breakdown of true/false positives and negatives to assess classification performance (Correct answer)
- It measures the correlation between input features
- It displays the weights of each neuron in the network
Correct answer: It shows the breakdown of true/false positives and negatives to assess classification performance
A confusion matrix summarizes prediction results by showing correct and incorrect classifications for each class, enabling computation of metrics like precision and recall.
Question 6: In reinforcement learning, what is the role of the 'reward' signal?
- It initializes the agent's policy to a known good state
- It provides feedback to the agent indicating how good or bad a taken action was (Correct answer)
- It sets the learning rate for the neural network
- It defines the action space available to the agent
Correct answer: It provides feedback to the agent indicating how good or bad a taken action was
The reward signal is the feedback mechanism that tells the reinforcement learning agent whether its action was beneficial or harmful, guiding policy improvement.
Which type of machine learning algorithm learns from labeled training data to predict outcomes on new data?