CS CS Artificial Intelligence & Machine Learning 2 — Questions and Answers
Question 1: What does 'overfitting' mean in the context of machine learning models?
- The model performs well on training data but poorly on unseen test data (Correct answer)
- The model trains too slowly due to large datasets
- The model has too few parameters to learn patterns
- The model's predictions always match the training labels exactly regardless of input
Correct answer: The model performs well on training data but poorly on unseen test data
Overfitting occurs when a model memorizes training data noise rather than generalizing patterns, resulting in poor performance on new data.
Question 2: Which activation function is most commonly used in hidden layers of modern deep neural networks?
- Sigmoid
- Tanh
- ReLU (Correct answer)
- Softmax
Correct answer: ReLU
ReLU (Rectified Linear Unit) is widely used in hidden layers because it is computationally efficient and mitigates the vanishing gradient problem.
Question 3: What technique is used in random forests to create diversity among individual decision trees?
- Gradient boosting with residuals
- Bootstrap aggregating (bagging) with random feature subsets (Correct answer)
- Stacking predictions from prior trees
- Pruning each tree to the same depth
Correct answer: Bootstrap aggregating (bagging) with random feature subsets
Random forests use bagging to train each tree on a random bootstrap sample and also randomly select a subset of features at each split, creating diverse trees.
Question 4: In natural language processing, what does TF-IDF stand for?
- Text Frequency - Inverse Document Frequency
- Term Frequency - Inverse Document Frequency (Correct answer)
- Token Filter - Indexed Document Feature
- Text Feature - Iterative Data Format
Correct answer: Term Frequency - Inverse Document Frequency
TF-IDF (Term Frequency–Inverse Document Frequency) weighs terms by how often they appear in a document relative to how rare they are across all documents.
Question 5: What is the primary purpose of cross-validation in machine learning?
- To reduce the size of the training dataset
- To evaluate model generalization by testing on multiple held-out data splits (Correct answer)
- To speed up the training process using parallel computation
- To select the optimal activation function automatically
Correct answer: To evaluate model generalization by testing on multiple held-out data splits
Cross-validation estimates how well a model generalizes by repeatedly splitting the dataset into training and validation subsets and averaging performance across splits.
Question 6: Which algorithm is commonly used for dimensionality reduction by projecting data onto principal components?
- K-Means Clustering
- Principal Component Analysis (PCA) (Correct answer)
- Support Vector Machine (SVM)
- Gradient Descent
Correct answer: Principal Component Analysis (PCA)
PCA reduces dimensionality by transforming features into a smaller set of uncorrelated principal components that capture the most variance in the data.
What does 'overfitting' mean in the context of machine learning models?